Handwriting forming method and apparatus, and electronic device

ABSTRACT

A handwriting forming method, a handwriting forming apparatus, and an electronic device are provided. The method includes: determining a group of plurality of trajectory points according to a plurality of sampling points on a writing path on a working surface of a touch device, and obtaining trajectory information of each of the plurality of trajectory points, and the trajectory information including a coordinate, a flag bit and a pressure value; establishing a plurality of trajectory units in a raindrop shape corresponding to the plurality of trajectory points based on the trajectory information; determining a connection mode between trajectory units corresponding to adjacent trajectory points based on the trajectory information; and calculating connection points of the trajectory units according to the connection mode, and filling a polygon formed by the connection points of the trajectory units corresponding to the adjacent trajectory points, so as to form a handwriting for displaying.

The application is a U.S. National Phase Entry of InternationalApplication No. PCT/CN2021/080511 filed on Mar. 12, 2021, designatingthe United States of America and claiming priority to Chinese PatentApplication No. 202010367901.X, filed on Apr. 30, 2020. The presentapplication claims priority to and the benefit of the above-identifiedapplications and the above-identified applications are incorporated byreference herein in their entirety.

TECHNICAL FIELD

Embodiments of the present disclosure relate to a handwriting formingmethod, a handwriting forming apparatus, and an electronic device.

BACKGROUND

With the continuous development of touch screen technology, touchscreens have been widely used in intelligent terminals. Users caninteract with an intelligent terminal through a touch screen, therebycompleting the operation process of the intelligent terminalconveniently. Various application programs for intelligent terminals arealso widely developed, for example, the application programs for writingand drawing on the terminal device. Users can use a correspondingapplication program to operate on the touch screen with a finger or astylus, so that writing can be performed and various patterns can bedrawn.

SUMMARY

At least one embodiment of the present disclosure provides a handwritingforming method, and the method comprising: determining a group ofplurality of trajectory points according to a plurality of samplingpoints on a writing path on a working surface of a touch device andobtaining trajectory information of each of the plurality of trajectorypoints, in which the trajectory information comprises a coordinate, aflag bit and a pressure value, and the flag bit comprises dataindicating whether a corresponding trajectory point is a pen drop point;establishing a plurality of trajectory units in a raindrop shapecorresponding to the plurality of trajectory points in one-to-onecorrespondence based on the trajectory information; determining aconnection mode between trajectory units corresponding to adjacenttrajectory points based on the trajectory information; and calculatingconnection points of the trajectory units according to the connectionmode, and filling a polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points, so asto form a handwriting for displaying.

For example, in the method provided by an embodiment of the presentdisclosure, establishing the plurality of trajectory units in theraindrop shape corresponding to the plurality of trajectory points inone-to-one correspondence based on the trajectory information comprises:determining a first circle center coordinate of a first circle and afirst radius of the first circle; determining a second circle centercoordinate of a second circle and a second radius of the second circle;and filling the first circle and the second circle, and filling apolygon formed by common tangent points of the first circle and commontangent points of the second circle.

For example, in the method provided by an embodiment of the presentdisclosure, the first circle center coordinate is a coordinate of thecorresponding trajectory point, the first radius is a product of apressure sensing amount and a plurality of writing parameter presetvalues, the pressure sensing amount is obtained based on a pressurevalue of the corresponding trajectory point, and the first radius isgreater than the second radius.

For example, in the method provided by an embodiment of the presentdisclosure, the pressure sensing amount is calculated according to apressure sensing function:

${Pz} = \left\{ {\begin{matrix}{{{0.\ 2}5},{P < {0.4}}} \\{{{P^{2}/{0.6}}4},{{0.4} \leq P < 0.8}} \\{1,{P \geq {0.8}}}\end{matrix},} \right.$where Pz represents the pressure sensing amount and P represents thepressure value.

For example, in the method provided by an embodiment of the presentdisclosure, the second circle center coordinate is obtained according tothe first circle center coordinate, a circle center distance, and anangle of a circle center connection line, the circle center distance isQ times of a product of a brush length and a pressure value of thecorresponding trajectory point, and 2≤Q≤7, the angle of the circlecenter connection line is an angle between a connection line between acircle center of the first circle and a circle center of the secondcircle and an x-axis direction of a coordinate system where the firstcircle center coordinate is located, and the angle of the circle centerconnection line ranges from 15 to 60 degrees.

For example, in the method provided by an embodiment of the presentdisclosure, 4.5≤Q≤5.5, and the angle of the circle center connectionline ranges from 25 to 35 degrees.

For example, in the method provided by an embodiment of the presentdisclosure, the second radius is calculated according to a formula:R2=0.5*R1*t, where R1 represents the first radius, R2 represents thesecond radius, t represents an ink density, t=max(0.8*T/n, 0.6), T is aconstant, and n is a serial number of a trajectory point.

For example, in the method provided by an embodiment of the presentdisclosure, determining the connection mode between the trajectory unitscorresponding to the adjacent trajectory points based on the trajectoryinformation comprises: for trajectory points other than the pen droppoint, calculating a slope of a connection line between a currenttrajectory point and a previous trajectory point; and according to theslope, a coordinate of the current trajectory point, and a coordinate ofthe previous trajectory point, determining a connection mode adopted bya trajectory unit corresponding to the current trajectory point. Theslope is calculated according to a formula:

${k = \frac{{y2} - {y1}}{{x2} - {x1}}},$where k represents the slope, (x2, y2) represents the coordinate of thecurrent trajectory point, and (x1, y1) represents the coordinate of theprevious trajectory point.

For example, in the method provided by an embodiment of the presentdisclosure, the connection mode comprises a first connection mode, asecond connection mode, a third connection mode, and a fourth connectionmode. According to the slope, the coordinate of the current trajectorypoint, and the coordinate of the previous trajectory point, determiningthe connection mode adopted by the trajectory unit corresponding to thecurrent trajectory point comprises: in the case where |k|≤0.6 or|x2−x1|<1, determining that the trajectory unit corresponding to thecurrent trajectory point adopts the first connection mode; in the casewhere −0.9<k<−0.6 and x2>x1, determining that the trajectory unitcorresponding to the current trajectory point adopts the secondconnection mode; in the case where 0.6<k<1 and y2<y1, determining thatthe trajectory unit corresponding to the current trajectory point adoptsthe third connection mode; and otherwise, determining that thetrajectory unit corresponding to the current trajectory point adopts thefourth connection mode.

For example, in the method provided by an embodiment of the presentdisclosure, calculating the connection points of the trajectory unitsaccording to the connection mode, and filling the polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, so as to form the handwriting for displaying,comprises: for the trajectory points other than the pen drop point,calculating the connection points of the trajectory unit according toone selected from a group consisting of the first connection mode, thesecond connection mode, the third connection mode, and the fourthconnection mode that are determined; and filling the polygon formed bythe connection points of the trajectory units corresponding to theadjacent trajectory points.

For example, in the method provided by an embodiment of the presentdisclosure, the connection points of the trajectory unit comprise afirst connection point m1 and a second connection point n1, and in thecase of adopting the first connection mode, the first connection pointm1 and the second connection point n1 are calculated according to aformula:

$\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{floor}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$where (m.x, m.y) represents a coordinate of the first connection pointm1, (n.x, n.y) represents a coordinate of the second connection pointn1, (c1.x, c1.y) represents the first circle center coordinate, (c2.x,c2.y) represents the second circle center coordinate, R1 represents thefirst radius, R2 represents the second radius, θ represents an angle ofa circle center connection line, and the coordinate of the firstconnection point m1, the coordinate of the second connection point n1,the first circle center coordinate, and the second circle centercoordinate are located in a same coordinate system on the workingsurface of the touch device.

For example, in the method provided by an embodiment of the presentdisclosure, the connection points of the trajectory unit comprise afirst connection point m2 and a second connection point n2, and in thecase of adopting the second connection mode, the first connection pointm2 and the second connection point n2 are calculated according to aformula:

$\left\{ {\begin{matrix}{{m.x} = {{c{2.x}} - {R1}}} \\{{m.y} = {{{floor}\left( {{c2.y} - {R2}} \right)} - 2}} \\{{n.x} = {{c{2.x}} - {R1}}} \\{{n.y} = {{{ceil}\left( {{c2.y} + {R2}} \right)} + 1}}\end{matrix},} \right.$where (m.x, m.y) represents a coordinate of the first connection pointm2, (n.x, n.y) represents a coordinate of the second connection pointn2, (c2.x, c2.y) represents the second circle center coordinate, R1represents the first radius, R2 represents the second radius, and thecoordinate of the first connection point m2, the coordinate of thesecond connection point n2, and the second circle center coordinate arelocated in a same coordinate system on the working surface of the touchdevice.

For example, in the method provided by an embodiment of the presentdisclosure, the connection points of the trajectory unit comprise afirst connection point m3 and a second connection point n3, and in thecase of adopting the third connection mode, the first connection pointm3 and the second connection point n3 are calculated according to aformula:

$\left\{ {\begin{matrix}{{m.x} = {c{2.x}}} \\{{m.y} = {{floor}\left( {{c2.y} - {R2}} \right)}} \\{{n.x} = {c2.x}} \\{{n.y} = {{ceil}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$where (m.x, m.y) represents a coordinate of the first connection pointm3, (n.x, n.y) represents a coordinate of the second connection pointn3, (c2.x, c2.y) represents the second circle center coordinate, R2represents the second radius, and the coordinate of the first connectionpoint m3, the coordinate of the second connection point n3, and thesecond circle center coordinate are located in a same coordinate systemon the working surface of the touch device.

For example, in the method provided by an embodiment of the presentdisclosure, the connection points of the trajectory unit comprise afirst connection point m4 and a second connection point n4, and in thecase of adopting the fourth connection mode, the first connection pointm4 and the second connection point n4 are calculated according to aformula:

$\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{ceil}\left( {{c2.x} + {R2*\cos\theta}} \right)}} \\{{n.y} = {{{floor}\left( {{c2.y} + {R2}} \right)} - 1}}\end{matrix},} \right.$where (m.x, m.y) represents a coordinate of the first connection pointm4, (n.x, n.y) represents a coordinate of the second connection pointn4, (c1.x, c1.y) represents the first circle center coordinate, (c2.x,c2.y) represents the second circle center coordinate, R1 represents thefirst radius, R2 represents the second radius, θ represents an angle ofa circle center connection line, and the coordinate of the firstconnection point m4, the coordinate of the second connection point n4,the first circle center coordinate, and the second circle centercoordinate are located in a same coordinate system on the workingsurface of the touch device.

For example, in the method provided by an embodiment of the presentdisclosure, calculating the connection points of the trajectory unitsaccording to the connection mode, and filling the polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, so as to form the handwriting for displaying, furthercomprises: for a trajectory point serving as the pen drop point,determining connection points of a trajectory unit corresponding to thepen drop point according to a connection mode of a trajectory unitcorresponding to a trajectory point that is adjacent to the pen droppoint.

For example, in the method provided by an embodiment of the presentdisclosure, for the trajectory point serving as the pen drop point,determining the connection points of the trajectory unit correspondingto the pen drop point according to the connection mode of the trajectoryunit corresponding to the trajectory point that is adjacent to the pendrop point comprises: in the case where the connection mode of thetrajectory unit corresponding to the trajectory point that is adjacentto the pen drop point is the first connection mode, the secondconnection mode or the third connection mode, determining the connectionpoints of the trajectory unit corresponding to the pen drop point byadopting the connection mode of the trajectory unit corresponding to thetrajectory point that is adjacent to the pen drop point; and in the casewhere the connection mode of the trajectory unit corresponding to thetrajectory point that is adjacent to the pen drop point is the fourthconnection mode, calculating a first connection point m5 and a secondconnection point n5 of the trajectory unit corresponding to the pen droppoint according to a formula:

$\left\{ {\begin{matrix}{{m.x} = {c{1.x}}} \\{{m.y} = {{c{1.y}} + {R1}}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{c{2.y}} + {R2*\sin\theta} + 1}}\end{matrix},} \right.$where (m.x, m.y) represents a coordinate of the first connection pointm5, (n.x, n.y) represents a coordinate of the second connection pointn5, (c1.x, c1.y) represents the first circle center coordinate, (c2.x,c2.y) represents the second circle center coordinate, R1 represents thefirst radius, R2 represents the second radius, θ represents an angle ofa circle center connection line, and the coordinate of the firstconnection point m5, the coordinate of the second connection point n5,the first circle center coordinate, and the second circle centercoordinate are located in a same coordinate system on the workingsurface of the touch device.

For example, in the method provided by an embodiment of the presentdisclosure, calculating the connection points of the trajectory unitsaccording to the connection mode, and filling the polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, so as to form the handwriting for displaying, furthercomprises: before filling the polygon formed by the connection points ofthe trajectory units corresponding to the adjacent trajectory points,judging whether the connection mode of the trajectory unit correspondingto the current trajectory point is different from the connection mode ofthe trajectory unit corresponding to the previous trajectory point; andin the case of being different, calculating connection points of atrajectory unit corresponding to the previous trajectory point byadopting the connection mode of the trajectory unit corresponding to thecurrent trajectory point, to serve as repeated connection points of thetrajectory unit corresponding to the previous trajectory point. In thecase of filling the polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points, thepolygon between the trajectory unit corresponding to the previoustrajectory point and the trajectory unit corresponding to the currenttrajectory point is formed based on the repeated connection points.

For example, in the method provided by an embodiment of the presentdisclosure, before establishing the plurality of trajectory units in theraindrop shape, the method further comprises: selecting continuous Ztrajectory points comprising the pen drop point, adding a compensationvalue to the pressure value in the trajectory information of each of theZ trajectory points to obtain an updated pressure value, and replacingthe pressure value in the trajectory information with the updatedpressure value, where 5≤Z≤15 and Z is an integer.

For example, in the method provided by an embodiment of the presentdisclosure, Z compensation values corresponding to the Z trajectorypoints are successively reduced.

For example, the method provided by an embodiment of the presentdisclosure further comprises: performing an anti-aliasing treatment onan edge line of a filled pattern.

For example, in the method provided by an embodiment of the presentdisclosure, performing the anti-aliasing treatment on the edge line ofthe filled pattern comprises: dividing each display pixel that the edgeline passes through into two regions according to a diagonal line of thedisplay pixel, in which a sign of a slope of the diagonal line is sameas a sign of a slope of the edge line; judging a region where a linesegment of the edge line passing through the display pixel is located;in the case where the line segment is located in one of the two regions,allowing the display pixel where the line segment is located and adisplay pixel that is adjacent to the region where the line segment islocated in a y direction to display; and in the case where the linesegment coincides with the diagonal line, allowing the display pixelwhere the line segment is located to display.

For example, in the method provided by an embodiment of the presentdisclosure, transparency of the display pixel that is adjacent to theregion where the line segment is located in the y direction iscalculated according to a formula:

${{Td} = {❘{1 - \frac{d_{MN}}{\sqrt{2}/2}}❘}},$where Td represents the transparency, and d_(MN) represents a distancebetween vertices of the region where the line segment is located and theline segment.

For example, in the method provided by an embodiment of the presentdisclosure, determining the group of plurality of trajectory pointsaccording to the plurality of sampling points on the writing path on theworking surface of the touch device and obtaining the trajectoryinformation of each of the plurality of trajectory points comprises:selecting a part of sampling points out of all the sampling points onthe writing path; and obtaining the plurality of trajectory points basedon the part of the sampling points and obtaining the trajectoryinformation of the plurality of trajectory points.

For example, in the method provided by an embodiment of the presentdisclosure, a ratio of a number of the part of the sampling points to anumber of all the sampling points ranges from 1% to 5%.

At least one embodiment of the present disclosure further provides ahandwriting forming apparatus, which comprises: a sampling unit,configured to determine a group of plurality of trajectory pointsaccording to a plurality of sampling points on a writing path on aworking surface of a touch device and obtain trajectory information ofeach of the plurality of trajectory points, in which the trajectoryinformation comprises a coordinate, a flag bit and a pressure value, andthe flag bit comprises data indicating whether a correspondingtrajectory point is a pen drop point; a modeling unit, configured toestablish a plurality of trajectory units in a raindrop shapecorresponding to the plurality of trajectory points in one-to-onecorrespondence based on the trajectory information; a connection modedetermining unit, configured to determine a connection mode betweentrajectory units corresponding to adjacent trajectory points based onthe trajectory information; and a filling unit, configured to calculateconnection points of the trajectory units according to the connectionmode, and fill a polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points, so asto form a handwriting for displaying.

At least one embodiment of the present disclosure further provides anelectronic device, which comprises: a processor; and a memory,comprising one or more computer program modules. The one or morecomputer program modules are stored in the memory and configured to beexecuted by the processor, and the one or more computer program modulescomprise instructions for implementing the handwriting forming methodprovided by any one of the embodiments of the present disclosure.

For example, the electronic device provided by an embodiment of thepresent disclosure further comprises the touch device. The touch deviceis configured to acquire an initial handwriting on the working surfaceof the touch device.

For example, the electronic device provided by an embodiment of thepresent disclosure further comprises a display device. The displaydevice is configured to display the handwriting formed by thehandwriting forming method.

BRIEF DESCRIPTION OF THE DRAWINGS

In order to illustrate the technical solutions of the embodiments of thepresent disclosure more clearly, the following will briefly introducethe attached drawings of the embodiments. Obviously, the attacheddrawings in the following description merely relate to some embodimentsof the present disclosure and are not a limitation of the presentdisclosure.

FIG. 1 is a flow diagram of a handwriting forming method provided by atleast one embodiment of the present disclosure;

FIG. 2 is a flow diagram of step S110 in the handwriting forming methodshown in FIG. 1 ;

FIG. 3 is a flow diagram of step S120 in the handwriting forming methodshown in FIG. 1 ;

FIG. 4A is a first schematic diagram of a trajectory unit provided by atleast one embodiment of the present disclosure;

FIG. 4B is a second schematic diagram of the trajectory unit provided byat least one embodiment of the present disclosure;

FIG. 5 is a schematic diagram of pressure value samples provided by atleast one embodiment of the present disclosure;

FIG. 6 is a flow diagram of step S130 in the handwriting forming methodshown in FIG. 1 ;

FIG. 7A is a schematic diagram of a first connection mode provided by atleast one embodiment of the present disclosure;

FIG. 7B is a schematic diagram of a second connection mode provided byat least one embodiment of the present disclosure;

FIG. 7C is a schematic diagram of a third connection mode provided by atleast one embodiment of the present disclosure;

FIG. 7D is a schematic diagram of a fourth connection mode provided byat least one embodiment of the present disclosure;

FIG. 8 is a first flow diagram of step S140 in the handwriting formingmethod shown in FIG. 1 ;

FIG. 9 is a second flow diagram of step S140 in the handwriting formingmethod shown in FIG. 1 ;

FIG. 10 is a model connection diagram of different connection modesprovided by at least one embodiment of the present disclosure;

FIG. 11 is a flow diagram of anti-aliasing treatment provided by atleast one embodiment of the present disclosure;

FIG. 12A is a schematic diagram showing the anti-aliasing treatmentprovided by at least one embodiment of the present disclosure;

FIG. 12B is an enlarged view of area F in FIG. 12A;

FIG. 13 is an effect comparison diagram of the anti-aliasing treatmentprovided by at least one embodiment of the present disclosure;

FIG. 14 is an application flow diagram of a handwriting forming methodprovided by at least one embodiment of the present disclosure;

FIG. 15 is a system diagram which can be used to implement thehandwriting forming method provided by the embodiments of the presentdisclosure;

FIG. 16 is a schematic block diagram of a handwriting forming apparatusprovided by at least one embodiment of the present disclosure;

FIG. 17 is a schematic block diagram of an electronic device provided byat least one embodiment of the present disclosure;

FIG. 18 is a schematic block diagram of another electronic deviceprovided by at least one embodiment of the present disclosure; and

FIG. 19 is a schematic block diagram of yet another electronic deviceprovided by at least one embodiment of the present disclosure.

DETAILED DESCRIPTION

In order to make the purpose, technical solutions and advantages of theembodiments of the present disclosure clearer, the technical solutionsin the embodiments of the present disclosure will be described clearlyand completely in combination with the attached drawings in theembodiments of the present disclosure. Obviously, the describedembodiments are only part of the embodiments of the present disclosure,not all of them. Based on the described embodiments of the presentdisclosure, all other embodiments obtained by the person of ordinaryskill in the art without making creative work shall belong to theprotection scope of the present disclosure.

Unless otherwise defined, the technical or scientific terms used in thepresent disclosure shall have usual meanings understood by those withordinary skills in the field to which this disclosure belongs. The words“first”, “second” and similar words used in the present disclosure donot mean any order, quantity, or importance, but are only used todistinguish different components. Similarly, similar words such as “an”,“a” or “the” do not mean a quantity limit, but rather mean that there isat least one. Similar words such as “including” or “comprising” meanthat the elements or items appearing before the word cover the elementsor items listed after the word and their equivalents, but do not excludeother elements or items. Similar words such as “connecting” or“connected” are not limited to physical or mechanical connections, butcan comprise electrical connections, whether direct or indirect. “Up”,“Down”, “Left”, “Right”, etc. are only used to indicate the relativeposition relationship, and in the case that the absolute position of thedescribed object changes, the relative position relationship may alsochange accordingly.

In the process of writing when a user uses an intelligent terminal, theintelligent terminal can simulate and display the handwriting written bythe user, and the handwriting can be displayed in various types such asChinese brush pen writing, pen writing, etc. according to needs. TheChinese brush pen is a traditional Chinese writing tool and paintingtool, and its tip is made of animal hair, for example, and is in a longcone shape after absorbing ink for writing, for example. Chinese brushpen writing has strong Chinese characteristics, reflects the charm ofChinese calligraphy, and can provide users with attractive visualeffects.

However, in the usual method of simulating Chinese brush pen writing, alarge number of sampling points are needed for calculation andprocessing, which results in a large amount of calculation, a lot ofresources occupancy, and low processing efficiency. In addition, theusual method of simulating Chinese brush pen writing is mainly toestablish handwriting models for different writing skills when writingwith a Chinese brush pen, such as the hidden front and exposed front ofthe pen dropping, the slanted front and side front of the pen movement,etc., while ignoring the connection between the models, which makes theformed brush handwriting not smooth enough, aesthetics is insufficient,and the processing method is complicated and is not practical.

At least one embodiment of the present disclosure provides a handwritingforming method, a handwriting forming apparatus, and an electronicdevice. The handwriting forming method can obtain beautiful Chinesebrush pen handwriting, can obtain smooth handwriting, can embody variousstrokes, has small calculation amount, high processing efficiency, andstrong real-time performance, and is simple and practical.

Hereinafter, embodiments of the present disclosure will be explained indetail with reference to the attached drawings. It should be noted thatthe same reference numerals in different attached drawings will be usedto refer to the same elements that have been described.

At least one embodiment of the present disclosure provides a handwritingforming method, and the handwriting forming method includes: determininga group of plurality of trajectory points according to a plurality ofsampling points on a writing path on a working surface of a touchdevice, and obtaining trajectory information of each of the plurality oftrajectory points, the trajectory information including a coordinate, aflag bit and a pressure value, and the flag bit including dataindicating whether a corresponding trajectory point is a pen drop point;establishing a plurality of trajectory units in a raindrop shapecorresponding to the plurality of trajectory points in one-to-onecorrespondence based on the trajectory information; determining aconnection mode between trajectory units corresponding to adjacenttrajectory points based on the trajectory information; and calculatingconnection points of the trajectory units according to the connectionmode, and filling a polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points, so asto form a handwriting for displaying.

FIG. 1 is a flow diagram of a handwriting forming method provided by atleast one embodiment of the present disclosure.

For example, the handwriting forming method is applied to a computingdevice, and this computing device includes any electronic device withcomputing function, such as a mobile phone, a notebook computer, atablet computer, a desktop computer, a server, etc., and the embodimentsof the present disclosure are not limited in this aspect. For example,the computing device has a central processing unit (CPU) or a graphicsprocessing unit (GPU), and also includes a memory. The memory is, forexample, a non-volatile memory (for example, read only memory (ROM)), onwhich codes of an operating system are stored. For example, codes orinstructions are also stored on the memory, and the handwriting formingmethod provided by the embodiments of the present disclosure can berealized by running these codes or instructions.

For example, the computing device can also include a touch device, suchas a touch screen or a touch pad, to acquire initial handwriting formedon the working surface of the touch device when a user writes. The touchscreen can not only receive initial handwriting, but also perform acorresponding display at the same time, for example, the touch screencan be a capacitive touch screen, such as a self-capacitive touch screenor a mutual-capacitive touch screen, and it can also be a resistivetouch screen, a surface acoustic wave touch screen, an infrared touchscreen, etc., and the embodiments of the present disclosure are notlimited in this aspect. The user can write directly on the workingsurface of the touch screen with his/her finger, or can write on theworking surface of the touch screen with an active stylus or a passivestylus, and the embodiments of the present disclosure are not limited inthis aspect. Here, the working surface refers to a surface for detectinga user's touch operation, for example, a touch surface of a touchscreen. It should be noted that in the embodiments of the presentdisclosure, the type of the touch device is not limited, and it can benot only a touch screen, but also any device with touch function such asan interactive whiteboard, which can be determined according to actualneeds.

For example, the computing device can also include a display device, thedisplay device is, for example, a liquid crystal display (LCD), anorganic light emitting diode (OLED) display, a quantum dot lightemitting diode (QLED) display, a projection component, a VR head mounteddisplay device (for example, a VR helmet, VR glasses, etc.), an ARdisplay device, etc., and the embodiments of the present disclosure arenot limited in this aspect. The display device can display handwritingsuch as Chinese brush pen handwriting formed by the handwriting formingmethod provided by the embodiments of the present disclosure.

As shown in FIG. 1 , in at least one embodiment, the handwriting formingmethod includes following operations.

Step S110: determining a group of plurality of trajectory pointsaccording to a plurality of sampling points on a writing path on aworking surface of a touch device, and obtaining trajectory informationof each of the plurality of trajectory points, in which the trajectoryinformation includes a coordinate, a flag bit and a pressure value, andthe flag bit includes data indicating whether a corresponding trajectorypoint is a pen drop point;

step S120: establishing a plurality of trajectory units in a raindropshape corresponding to the plurality of trajectory points in one-to-onecorrespondence based on the trajectory information;

step S130: determining a connection mode between trajectory unitscorresponding to adjacent trajectory points based on the trajectoryinformation; and

step S140: calculating connection points of the trajectory unitsaccording to the connection mode, and filling a polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, so as to form a handwriting for displaying.

For example, in step S110, the touch device can be a touch screen, andaccordingly, the working surface can be a touch surface of the touchscreen to detect touch operations of a user. When the user writes on theworking surface of the touch device, different forces can be applied inthe process of pen dropping, pen movement, pen ending (or pen raising)and so on, so as to form a writing path, and the touch device can detecta plurality of sampling points distributed along the writing path. Forexample, when the touch device detects these sampling points, it canobtain the pressure values, coordinates, and flag bits of these samplingpoints. According to the detected sampling points, the touch device canobtain a group of plurality of trajectory points and trajectoryinformation of the trajectory points. For example, a group of trajectorypoints include a plurality of trajectory points.

For example, the trajectory information includes a pressure value, acoordinate, and a flag bit. The pressure value indicates how hard a usertouches a corresponding trajectory point (corresponding sampling point).For example, the pressure value can be an original pressure value or apressure value after normalization, and the embodiments of the presentdisclosure are not limited in this aspect. For example, the pressurevalue can be detected by a pressure sensor provided in the touch device,and the pressure sensor can include a piezoelectric film to sense thepressure applied to the working surface when the user writes on theworking surface of the touch device; or, when the user writes on theworking surface of the touch device with a stylus, the stylus can beprovided with a pressure sensor, so as to detect the pressure applied tothe working surface by the user. The embodiments of the presentdisclosure do not limit the manner of detecting the pressure value. Thecoordinate represents the position of the corresponding trajectory point(corresponding sampling point) in the working surface. For example, thecoordinate is a coordinate in a Cartesian coordinate system within theworking surface, and the origin of the Cartesian coordinate system isdetermined by the setting of the touch device itself. The flag bitincludes data indicating whether the corresponding trajectory point is apen drop point, the pen drop point is, for example, the first samplingpoint detected in a continuous writing path. For example, the flag bitcan be a preset number, character, string, etc. For example, in someexamples, in the case that the corresponding trajectory point is the pendrop point, the flag bit can be set to “down”. For example, the flag bitcan also include data indicating whether the corresponding trajectorypoint is a pen ending point and a pen movement point, for example, canbe set to “up” and “move-on” respectively. The setting method andsetting rules of the flag bit can be determined according to actualneeds, and the embodiments of the present disclosure are not limited inthis aspect.

It should be noted that in the embodiments of the present disclosure,the pressure value, coordinate, and flag bit in the trajectoryinformation are detected by the touch device, and the acquisition methodand expression method of these information can be determined accordingto the setting of the touch device itself, and the embodiments of thepresent disclosure are not limited in this aspect. When performing thehandwriting forming method provided by the embodiments of the presentdisclosure, the trajectory information of the trajectory point (that is,the pressure value, coordinate, and flag bit) can be directly acquiredfrom the touch device.

For example, as shown in FIG. 2 , the above step S110 can include thefollowing operations.

Step S111: selecting a part of sampling points out of all the samplingpoints on the writing path; and

step S112: obtaining a plurality of trajectory points based on the partof the sampling points, and obtaining the trajectory information of theplurality of trajectory points.

For example, in step S111, among all the sampling points on a writingpath detected by a touch device, a part of the sampling points isselected, that is, all the sampling points are sparsely sampled. Forexample, in some examples, the ratio of the number of the selectedsampling points to the number of all the sampling points ranges from 1%to 5%, for example, 2%. For example, for all the sampling pointsdetected by the touch device, 1-5 sampling points are selected in every100 sampling points, for example, 2 sampling points are selected. Forexample, in other examples, the ratio of the number of the selectedsampling points to the number of all the sampling points ranges from 1%to 40%. Regarding the ratio of the number of the selected samplingpoints to the number of all the sampling points, this can be determinedaccording to actual needs, and the embodiments of the present disclosureare not limited in this aspect.

For example, the serial number of the sampling point serving as the pendrop point is 1, and all the sampling points on the writing path arenumbered sequentially to form a sequence, and the selected samplingpoints are relatively evenly distributed in the sequence composed of allthe sampling points. Thereby, the number of the sampling points thatneed to be processed can be greatly reduced by sparse sampling, and theprocessing efficiency and real-time performance can be improved.

For example, in step S112, trajectory points are obtained based on thesampling points that are selected. For example, in some examples, theselected sampling points can be regarded as the trajectory points, andaccordingly, the trajectory information of each of the trajectory pointscan be obtained from the touch device. For example, in some otherexamples, the selected sampling points can be smoothed, and aftersmoothing, the trajectory points and the corresponding trajectoryinformation can be obtained. For example, smoothing processing can adoptusual smoothing processing algorithms and smoothing processing methods,and the embodiments of the present disclosure are not limited in thisaspect.

For example, the sampling point is a point obtained by a touchacquisition component in a touch device through touch detection, and thesampling point carries information such as speed, coordinate, and type(for example, whether it is a pen drop point). According to the samplingpoints provided by the touch device, sparse sampling and interpolationprocessing are carried out, so that trajectory points can be obtained.For example, sparse sampling has been described above and is notrepeated here. For example, the interpolation processing can make theplurality of trajectory points obtained smoother, that is, theinterpolation processing can achieve the effect of the smoothingprocessing described above. When interpolating a certain sampling point,the required parameters include, for example, the information of theother two sampling points adjacent to the sampling point, for example,the information of a sampling point before the sampling point and theinformation of a sampling point after the sampling point. Thereby, theinformation of the trajectory point corresponding to the sampling point(for example, speed, coordinate, type, etc.) can be obtained byinterpolation calculation. After interpolation processing, a group oftrajectory points can be obtained. For example, the type of a trajectorypoint is the same as the type of a corresponding sampling point, and thespeed of a trajectory point is obtained by simulation calculation, forexample, by calculating the mean value or numerical difference of thespeed of the previous sampling point and the next sampling point. Thedetailed description about the interpolation processing can refer to theconventional design, which is not repeated here.

For example, as shown in FIG. 1 , in step S120, a plurality oftrajectory units in a raindrop shape corresponding to a plurality oftrajectory points in one-to-one correspondence are established based onthe trajectory information, that is, the trajectory unit is establishedfor each of the trajectory points, respectively. A trajectory unitconsists of two solid circles with different sizes and the commontangent line of the two circles, and has a shape similar to a raindrop.

For example, as shown in FIG. 3 , the above step S120 may include thefollowing operations.

Step S121: determining a first circle center coordinate of a firstcircle and a first radius of the first circle;

step S122: determining a second circle center coordinate of a secondcircle and a second radius of the second circle; and

step S123: filling the first circle and the second circle, and filling apolygon formed by common tangent points of the first circle and commontangent points of the second circle.

The above steps S121-S123 are described below in combination with thetrajectory units shown in FIG. 4A and FIG. 4B.

For example, as shown in FIG. 4A and FIG. 4B, a trajectory unit includesa first circle 01 and a second circle 02. The radius of the first circle01 is called the first radius R1, and the radius of the second circle 02is called the second radius R2, and the first radius R1 is greater thanthe second radius R2, that is, the first circle 01 is a larger circleand the second circle 02 is a smaller circle. The common tangent pointsof the first circle 01 and the second circle 02 are A1, A2, A3 and A4,and the common tangent lines are A1A2 and A3A4 . The trajectory unit iscomposed of the first circle 01, the second circle 02, and the polygonformed by the common tangent points A1, A2, A3 and A4.

For example, in step S121, the coordinate of the circle center c1 of thefirst circle 01 is called the first circle center coordinate, and thefirst circle center coordinate is the coordinate of the correspondingtrajectory point, for example, the coordinate in the trajectoryinformation can be directly used as the first circle center coordinate.

The first radius R1 is the product of a pressure sensing amount and aplurality of writing parameter preset values. For example, the pluralityof writing parameter preset values include a Chinese brush pen diameterand a drawing line width, and accordingly, the first radius R1 is theproduct of the pressure sensing amount, the Chinese brush pen diameter,and the drawing line width. Different Chinese brush pen diameters anddifferent drawing line widths can make the formed handwriting havedifferent visual effects. For example, the Chinese brush pen diameterand the drawing line width can adopt preset default values or can be setby the user before performing the handwriting forming method, which canbe determined according to actual needs, and the embodiments of thepresent disclosure are not limited in this aspect.

For example, the pressure sensing amount is obtained based on thepressure value of the corresponding trajectory point. Because the forceof the user when writing on the touch device is variable, the force maybe light or heavy, and only when the sizes of the trajectory unitscorresponding to the adjacent trajectory points do not change greatly, arelatively beautiful handwriting can be formed. Moreover, thehandwriting is usually thinner when a Chinese brush pen is used lightlywhen writing. Based on the above considerations, the pressure sensingamount is used to establish the trajectory unit, so that the formedhandwriting is relatively smooth, and it can also embody thecharacteristics of the speed of the pen movement. As shown in FIG. 5 ,the pressure values of a large number of sampling points when differentusers are writing can be collected through experiments to obtain a largenumber of pressure value samples, and then a pressure sensing functioncan be obtained according to the pressure value samples. Here, thepressure value is the data after normalization.

For example, the pressure sensing function can be obtained by adoptingstatistical methods and combining with simulation optimizationprocessing. For example, the pressure sensing function is as follows:

${Pz} = \left\{ {\begin{matrix}{{{0.\ 2}5},{P < {0.4}}} \\{{P^{2}/0.64},{{0.4} \leq P < 0.8}} \\{1,{P \geq {0.8}}}\end{matrix},} \right.$where Pz represents the pressure sensing amount and P represents thepressure value. After obtaining the pressure sensing function, whenperforming the handwriting forming method provided by the embodiments ofthe present disclosure, for any trajectory point, the pressure sensingamount can be calculated based on the pressure value of the trajectorypoint, so that the change of the pressure sensing amount is relativelygentle.

For example, in some examples, the pressure value provided by the touchdevice after touch detection is the data after normalization processing,which can be directly substituted into the above formula to obtain thepressure sensing amount. For example, in some other examples, thepressure value provided by the touch device after touch detection is notnormalized, and therefore, before calculating the pressure sensingamount, the pressure value provided by the touch device needs to benormalized, and the normalized pressure value is substituted into theabove formula to obtain the pressure sensing amount.

For example, the value range of the pressure sensing amount Pz rangesfrom 0 to 1. In the case that the pressure value P is less than 0.4, thepressure sensing amount is set to a fixed value of 0.25, therebyensuring a relatively stable pen drop effect when the user is writing.In the case that the pressure value is 0.4≤P<0.8, by squaring thepressure value P and dividing it by the constant value of 0.64, a moreobvious change in the thickness of the pen movement when writing can bemade. In the case that the pressure value P≥0.8, the pressure sensingamount is set to a fixed value of 1, thereby preventing handwriting fromsuddenly becoming larger and affecting appearance.

It should be noted that in the embodiments of the present disclosure,the above pressure sensing function is only exemplary rather thanrestrictive, the pressure sensing function can be adjusted according toactual needs, and the embodiments of the present disclosure are notlimited in this aspect. For example, each coefficient in the pressuresensing function can be adjusted, such as increasing or decreasingappropriately, the division area of the pressure value P in the pressuresensing function can also be adjusted, and the pressure sensing functioncan be redesigned and inducted, which can be determined according toactual needs.

For example, in step S122, the coordinate of the circle center c2 of thesecond circle 02 is called the second circle center coordinate, and thesecond circle center coordinate is obtained according to the firstcircle center coordinate, the circle center distance, and the angle ofthe circle center connection line. For example, the circle centerdistance is the distance between the circle center c1 of the firstcircle 01 and the circle center c2 of the second circle 02. The circlecenter distance is Q times of the product of the brush length and thepressure value of the corresponding trajectory point, and 2≤Q≤7. Forexample, the brush length can adopt the preset default value, or it canbe set by the user before performing the handwriting forming method,which can be determined according to actual needs, and the embodimentsof the present disclosure are not limited in this aspect. For example,the angle of the circle center connection line is the angle θ betweenthe connection line L1 between the circle center c1 of the first circle01 and the circle center c2 of the second circle 02 and an x-axisdirection of a coordinate system where the first circle centercoordinate is located. Here, the angle θ is an acute angle, and is theangle between the connection line L1 and the negative direction ofx-axis. Because the first circle center coordinate is the coordinate ofthe corresponding trajectory point, which is provided by the touchdevice, and therefore, the coordinate system where the first circlecenter coordinate is located is the coordinate system defined by thetouch device and located on the working surface. For example, the angleof the circle center connection line ranges from 15 to 60 degrees, forexample, from 20 to 45 degrees, or may be 30 degrees. On the premise ofknowing the first circle center coordinate, the circle center distanceand the angle of the circle center connection line, the second circlecenter coordinate can be obtained by using the knowledge of planegeometry.

For example, in some examples, 4.5≤Q≤5.5, and the angle of the circlecenter connection line ranges from 25 to 35 degrees. For example, insome other examples, Q=5, and the angle of the circle center connectionline is 30 degrees, thereby the handwriting formed by the trajectoryunit that is obtained is more beautiful.

For example, the second radius R2 is calculated according to thefollowing formula: R2=0.5*R1*t. Here, t represents ink density, andt=max(0.8*T/n, 0.6). For example, T is a constant and can be set to 0.8.The alphabet “n” is a serial number of the trajectory point. Forexample, the serial number of the trajectory point serving as the pendrop point is 1, and subsequent trajectory points are numbered as 2, 3,4, etc. It should be noted that in the embodiments of the presentdisclosure, the above formula for calculating the ink density t isexemplary rather than restrictive, and can be adjusted according toactual needs, and the embodiments of the present disclosure are notlimited in this aspect.

For example, in step S123, on the premise of knowing the first circlecenter coordinate, the first radius R1, the second circle centercoordinate and the second radius R2, the common tangent points A1, A2,A3 and A4 of the first circle 01 and the second circle 02 can beobtained by calculating, and then the first circle 01, the second circle02, and the polygon formed by the common tangent points A1, A2, A3 andA4 are filled, so as to obtain the trajectory unit corresponding to thetrajectory point.

For example, as shown in FIG. 1 , in step S130, the connection modebetween the trajectory units corresponding to the adjacent trajectorypoints is determined based on the trajectory information. To embodydifferent strokes and make handwriting more beautiful, differentconnection modes for the trajectory units corresponding to thetrajectory points in different strokes are adopted according to thecharacteristics of the strokes. It should be noted that “adjacent” doesnot mean that the positions of two trajectory points on the workingsurface of the touch device are adjacent, but means that the twotrajectory points are adjacent in the sequence composed of a group oftrajectory points that are sequentially numbered and obtained based on aplurality of sampling points on the writing path, that is, the serialnumbers of the two trajectory points are adjacent. For example, thetrajectory point with serial number 1 is adjacent to the trajectorypoint with serial number 2. For example, the trajectory point withserial number 4 is not only adjacent to the trajectory point with serialnumber 5, but also adjacent to the trajectory point with serial number3.

For example, as shown in FIG. 6 , the above step S130 may include thefollowing operations.

Step S131: for trajectory points other than the pen drop point,calculating the slope of the connection line between the currenttrajectory point and the previous trajectory point; and

step S132: according to the slope, the coordinate of the currenttrajectory point, and the coordinate of the previous trajectory point,determining the connection mode adopted by the trajectory unitcorresponding to the current trajectory point.

For example, in step S131, the slope can be obtained by calculatingaccording to the following formula:

${k = \frac{{y2} - {y1}}{{x2} - {x1}}},$where k represents the slope, (x2, y2) represents the coordinate of thecurrent trajectory point, and (x1, y1) represents the coordinate of theprevious trajectory point.

For example, in step S132, the above connection modes include a firstconnection mode, a second connection mode, a third connection mode, anda fourth connection mode. For example, in some examples, the firstconnection mode corresponds to the “horizontal” stroke, the secondconnection mode corresponds to the “right-falling” stroke, the thirdconnection mode corresponds to the “raising” stroke, and the fourthconnection mode corresponds to other strokes except the above threestrokes. By dividing different connection modes, the handwriting formedby the handwriting forming method can be more in line with the writingcharacteristics of different strokes and more beautiful.

According to the slope k, the coordinate (x2, y2) of the currenttrajectory point and the coordinate (x1, y1) of the previous trajectorypoint, the following rules can be adopted to determine the connectionmode adopted by the trajectory unit corresponding to the currenttrajectory point.

In the case where |k|≤0.6 or |x2−x1|<1, it is determined that thetrajectory unit corresponding to the current trajectory point adopts thefirst connection mode, and the first connection mode is, for example,the connection mode shown in FIG. 7A, that is, the connection modecorresponding to the “horizontal” stroke. In the case where −0.9<k<−0.6and x2>x1, it is determined that the trajectory unit corresponding tothe current trajectory point adopts the second connection mode, and thesecond connection mode is, for example, the connection mode shown inFIG. 7B, that is, the connection mode corresponding to the“right-falling” stroke. In the case where 0.6<k<1 and y2<y1, it isdetermined that the trajectory unit corresponding to the currenttrajectory point adopts the third connection mode, and the thirdconnection mode is, for example, the connection mode shown in FIG. 7C,that is, the connection mode corresponding to the “raising” stroke.Otherwise, it is determined that the trajectory unit corresponding tothe current trajectory point adopts the fourth connection mode, and thefourth connection mode is, for example, the connection mode shown inFIG. 7D, that is, the connection mode corresponding to other strokesexcept the above three strokes.

For example, when determining the connection mode, it can be judged inorder according to the above contents. That is to say, first, it isjudged whether the conditions for adopting the first connection mode aresatisfied; if not, then it is judged whether the conditions for adoptingthe second connection mode are satisfied; if still not, then it isjudged whether the conditions for adopting the third connection mode aresatisfied; if yet still not, the fourth connection mode is adopted.

It should be noted that the above rules for determining the connectionmode are exemplary rather than restrictive, the above rules fordetermining the connection mode can be adjusted according to the actualneeds, and the embodiments of the present disclosure are not limited inthis aspect.

It should be noted that for the trajectory point serving as the pen droppoint (the trajectory point with serial number 1, that is, the firsttrajectory point on a continuous writing path), there is no need todetermine the connection mode of the trajectory unit corresponding tothe trajectory point, and how to determine the connection points of thetrajectory unit corresponding to the trajectory point will be describedhereinafter, which is not repeated here.

For example, as shown in FIG. 1 , in step S140, after determining theconnection mode, the connection points of the trajectory unit arecalculated according to the connection mode, and the polygon formed bythe connection points of the trajectory units corresponding to theadjacent trajectory points is filled, so as to form the handwriting fordisplaying.

For example, as shown in FIG. 8 , the above step S140 may include thefollowing operations.

Step S141: for the trajectory points other than the pen drop point,calculating the connection points of the trajectory unit according toone selected from the group consisting of the first connection mode, thesecond connection mode, the third connection mode and the fourthconnection mode that are determined;

step S142: filling the polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points; and

step S143: for the trajectory point serving as the pen drop point,determining the connection points of the trajectory unit correspondingto the pen drop point according to the connection mode of the trajectoryunit corresponding to the trajectory point that is adjacent to the pendrop point.

For example, in step S141, according to different connection modes,different formulas are adopted to calculate the connection points of thetrajectory unit, and the calculated connection points are used tosubsequently fill the area between adjacent trajectory units. The methodfor calculating the connection points is described in detail incombination with the connection mode shown in FIGS. 7A-7D.

For example, as shown in FIG. 7A, in the case that the trajectory unitE2 corresponding to the current trajectory point adopts the firstconnection mode, the connection points of the trajectory unit E2 includea first connection point m1 and a second connection point n1. The firstconnection point m1 and the second connection point n1 are calculatedaccording to the following formula:

$\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{floor}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$where (m.x, m.y) represents the coordinate of the first connection pointm1, (n.x, n.y) represents the coordinate of the second connection pointn1, (c1.x, c1.y) represents the first circle center coordinate in thetrajectory unit E2, (c2.x, c2.y) represents the second circle centercoordinate in the trajectory unit E2, R1 represents the first radius ofthe trajectory unit E2, R2 represents the second radius of thetrajectory unit E2, and θ represents the angle of the circle centerconnection line in the trajectory unit E2. For example, the coordinateof the first connection point m1, the coordinate of the secondconnection point n1, the first circle center coordinate and the secondcircle center coordinate are located in the same coordinate system onthe working surface of the touch device. In the above formula, “floor”means rounding down.

For example, the first connection mode corresponds to the “horizontal”stroke, and the part between the trajectory unit E2 corresponding to thecurrent trajectory point and the trajectory unit E1 corresponding to theprevious trajectory point is a line segment in the “horizontal” stroke.The first connection point m1 and the second connection point n1calculated by adopting the above modes are used for subsequent filling,which can make the formed handwriting more in line with the writingcharacteristics of the “horizontal” stroke.

For example, as shown in FIG. 7B, in the case that the trajectory unitE2 corresponding to the current trajectory point adopts the secondconnection mode, the connection points of the trajectory unit E2 includethe first connection point m2 and the second connection point n2. Thefirst connection point m2 and the second connection point n2 arecalculated according to the following formula:

$\left\{ {\begin{matrix}{{m.x} = {{c{2.x}} - {R1}}} \\{{m.y} = {{{floor}\left( {{c2.y} - {R2}} \right)} - 2}} \\{{n.x} = {{c{2.x}} - {R1}}} \\{{n.y} = {{{ceil}\left( {{c2.y} + {R2}} \right)} + 1}}\end{matrix},} \right.$where (m.x, m.y) represents the coordinate of the first connection pointm2, (n.x, n.y) represents the coordinate of the second connection pointn2, (c2.x, c2.y) represents the second circle center coordinate in thetrajectory unit E2, R1 represents the first radius in the trajectoryunit E2, and R2 represents the second radius in the trajectory unit E2.For example, the coordinate of the first connection point m2, thecoordinate of the second connection point n2, and the second circlecenter coordinate are located in the same coordinate system on theworking surface of the touch device. In the above formula, “floor” meansrounding down and “ceil” means rounding up.

For example, the second connection mode corresponds to the“right-falling” stroke, and the part between the trajectory unit E2corresponding to the current trajectory point and the trajectory unit E1corresponding to the previous trajectory point is a line segment in the“right-falling” stroke. The first connection point m2 and the secondconnection point n2 calculated by adopting the above modes are used forsubsequent filling, which can make the formed handwriting more in linewith the writing characteristics of the “right-falling” stroke.

For example, as shown in FIG. 7C, in the case that the trajectory unitE2 corresponding to the current trajectory point adopts the thirdconnection mode, the connection points of the trajectory unit E2 includea first connection point m3 and a second connection point n3. The firstconnection point m3 and the second connection point n3 are calculatedaccording to the following formula:

$\left\{ {\begin{matrix}{{m.x} = {c{2.x}}} \\{{m.y} = {{floor}\left( {{c2.y} - {R2}} \right)}} \\{{n.x} = {c{2.x}}} \\{{n.y} = {{ceil}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$where (m.x, m.y) represents the coordinate of the first connection pointm3, (n.x, n.y) represents the coordinate of the second connection pointn3, (c2.x, c2.y) represents the second circle center coordinate in thetrajectory unit E2, and R2 represents the second radius in thetrajectory unit E2. For example, the coordinate of the first connectionpoint m3, the coordinate of the second connection point n3, and thesecond circle center coordinate are located in the same coordinatesystem on the working surface of the touch device. Similarly, in theabove formula, “floor” means rounding down and “ceil” means rounding up.

For example, the third connection mode corresponds to the “raising”stroke, and the part between the trajectory unit E2 corresponding to thecurrent trajectory point and the trajectory unit E1 corresponding to theprevious trajectory point is a line segment in the “raising” stroke. Thefirst connection point m3 and the second connection point n3 calculatedby adopting the above modes are used for subsequent filling, which canmake the formed handwriting more in line with the writingcharacteristics of the “raising” stroke.

For example, as shown in FIG. 7D, in the case that the trajectory unitE2 corresponding to the current trajectory point adopts the fourthconnection mode, the connection points of the trajectory unit E2 includea first connection point m4 and a second connection point n4. The firstconnection point m4 and the second connection point n4 are calculatedaccording to the following formula:

$\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{ceil}\left( {{c2.x} + {R2*\cos\theta}} \right)}} \\{{n.y} = {{{floor}\left( {{c2.y} + {R2}} \right)} - 1}}\end{matrix},} \right.$where (m.x, m.y) represents the coordinate of the first connection pointm4, (n.x, n.y) represents the coordinate of the second connection pointn4, (c1.x, c1.y) represents the first circle center coordinate in thetrajectory unit E2, (c2.x, c2.y) represents the second circle centercoordinate in the trajectory unit E2, R1 represents the first radius ofthe trajectory unit E2, R2 represents the second radius of thetrajectory unit E2, and θ represents the angle of the circle centerconnection line in the trajectory unit E2. For example, the coordinateof the first connection point m4, the coordinate of the secondconnection point n4, the first circle center coordinate and the secondcircle center coordinate are located in the same coordinate system onthe working surface of the touch device. Similarly, in the aboveformula, “floor” means rounding down and “ceil” means rounding up.

For example, the fourth connection mode corresponds to other strokesexcept the above-described three strokes, and the part between thetrajectory unit E2 corresponding to the current trajectory point and thetrajectory unit E1 corresponding to the previous trajectory point is aline segment in the stroke. The first connection point m4 and the secondconnection point n4 calculated by adopting the above modes are used forsubsequent filling, which can make the formed handwriting have bettercoherence and is suitable for forming a plurality of strokes.

It should be noted that in the embodiments of the present disclosure,the formulas for calculating the connection points adopted respectivelyby the first connection mode, the second connection mode, the thirdconnection mode, and the fourth connection mode are only exemplaryrather than restrictive, the above formulas can be adjusted according toactual needs, and the embodiments of the present disclosure are notlimited in this aspect.

For example, after the connection points of the trajectory unitcorresponding to each of the trajectory points are calculated, thepolygon formed by the connection points of the trajectory unitscorresponding to the adjacent trajectory points is filled, therebymaking the plurality of trajectory units corresponding to the pluralityof trajectory points form continuous handwriting between each other.

For example, in the first connection mode shown in FIG. 7A, the firstconnection point m1 and the second connection point n1 are two adjacentvertices of the polygon (for example, a quadrilateral) between thetrajectory unit E2 and the trajectory unit E1, and the other twovertices of the polygon are two connection points on the trajectory unitE1. Filling the polygon can make continuous handwriting formed betweenthe trajectory unit E2 and the trajectory unit E1. For example, in thesecond connection mode shown in FIG. 7B, the first connection point m2and the second connection point n2 are two adjacent vertices of thepolygon (for example, a quadrilateral) between the trajectory unit E2and the trajectory unit E1, and the other two vertices of the polygonare two connection points on the trajectory unit E1. Filling the polygoncan make continuous handwriting formed between the trajectory unit E2and the trajectory unit E1. In the third connection mode shown in FIG.7C and the fourth connection mode shown in FIG. 7D, the filling of thepolygon adopts a similar mode, which is not repeated here.

For example, as shown in FIG. 8 , in step S143, for the trajectory pointserving as the pen drop point, the connection points of the trajectoryunit corresponding to the pen drop point is determined according to theconnection mode of the trajectory unit corresponding to the trajectorypoint adjacent to the pen drop point. For example, the serial number ofthe trajectory point serving as the pen drop point is 1, and thus theconnection points of the trajectory unit corresponding to the pen droppoint is determined according to the connection mode of the trajectoryunit corresponding to the trajectory point with serial number 2, therebya polygon can be formed and filled between the trajectory unitcorresponding to the pen drop point and the trajectory unitcorresponding to the trajectory point with serial number 2.

In the case where the connection mode of the trajectory unitcorresponding to the trajectory point adjacent to the pen drop point(i.e. the trajectory point with serial number 2) is the first connectionmode, the second connection mode or the third connection mode, theconnection mode of the trajectory unit corresponding to the trajectorypoint adjacent to the pen drop point (i.e. the trajectory point withserial number 2) is adopted to determine the connection points of thetrajectory unit corresponding to the pen drop point. For example, insome examples, in the case that the connection mode of the trajectoryunit corresponding to the trajectory point with serial number 2 is thefirst connection mode, the first connection mode is adopted to calculatethe connection points of the trajectory unit corresponding to the pendrop point, that is, the formula corresponding to the aforementionedfirst connection mode is adopted to calculate the first connection pointand the second connection point of the trajectory unit corresponding tothe pen drop point. In the case that the connection mode of thetrajectory unit corresponding to the trajectory point with serial number2 is the second connection mode or the third connection mode, the secondconnection mode or the third connection mode is adopted to calculate theconnection points of the trajectory unit corresponding to the pen droppoint, that is, the formula corresponding to the aforementioned secondconnection mode or the third connection mode is adopted to calculate thefirst connection point and the second connection point of the trajectoryunit corresponding to the pen drop point, which may not be repeatedhere.

In the case where the connection mode of the trajectory unitcorresponding to the trajectory point adjacent to the pen drop point(i.e., the trajectory point with serial number 2) is the fourthconnection mode, the first connection point m5 and the second connectionpoint n5 of the trajectory unit corresponding to the pen drop point iscalculated according to the following formula:

$\left\{ {\begin{matrix}{{m.x} = {c{1.x}}} \\{{m.y} = {{c{1.y}} + {R1}}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{c{2.y}} + {R2*\sin\theta} + 1}}\end{matrix},} \right.$where (m.x, m.y) represents the coordinate of the first connection pointm5, (n.x, n.y) represents the coordinate of the second connection pointn5, (c1.x, c1.y) represents the first circle center coordinate of thetrajectory unit corresponding to the pen drop point, (c2.x, c2.y)represents the second circle center coordinate of the trajectory unitcorresponding to the pen drop point, R1 represents the first radius ofthe trajectory unit corresponding to the pen drop point, R2 is thesecond radius of the trajectory unit corresponding to the pen droppoint, and θ represents the angle of the circle center connection lineof the trajectory unit corresponding to the pen drop point. For example,the coordinate of the first connection point m5, the coordinate of thesecond connection point n5, the first circle center coordinate and thesecond circle center coordinate are located in the same coordinatesystem on the working surface of the touch device. In the case that thefirst connection point m5 and the second connection point n5 are usedfor subsequent filling, it can have a better pen drop shape and make thehandwriting more beautiful.

Through the above methods, after the connection points of the trajectoryunit corresponding to each of the trajectory points are calculated, theconnection points of the trajectory unit corresponding to any twoadjacent trajectory points can form a polygon (for example, theconnection points can serve as vertices to form a quadrangle), and thesepolygons are filled, so that a coherent handwriting can be formedbetween the plurality of trajectory units.

In the case that two different strokes are connected, because theconnection modes corresponding to different strokes are different, theremay be gaps at the connection position, which affects the aesthetics ofthe handwriting. In order to eliminate the gaps between differentstrokes, as shown in FIG. 9 , in at least one embodiment, in addition tothe above steps S141-S143, step S140 in FIG. 1 may further include thefollowing operations.

Step S144: before filling the polygon formed by the connection points ofthe trajectory units corresponding to the adjacent trajectory points,judging whether the connection mode of the trajectory unit correspondingto the current trajectory point is different from the connection mode ofthe trajectory unit corresponding to the previous trajectory point; and

step S145: in the case of being different, calculating the connectionpoints of the trajectory unit corresponding to the previous trajectorypoint by adopting the connection mode of the trajectory unitcorresponding to the current trajectory point, to serve as the repeatedconnection points of the trajectory unit corresponding to the previoustrajectory point.

For example, when filling the polygon formed by the connection points ofthe trajectory units corresponding to the adjacent trajectory points,the polygon between the trajectory unit corresponding to the previoustrajectory point and the trajectory unit corresponding to the currenttrajectory point is formed based on the repeated connection points.

FIG. 10 is a schematic diagram of the model connection of differentconnection modes provided by at least one embodiment of the presentdisclosure. The above steps S144 and S145 are described below incombination with FIG. 10 .

For example, as shown in FIG. 10 , the three trajectory units E3, E4 andE5 are respectively the trajectory units corresponding to three adjacenttrajectory points, and these three trajectory points are respectively,for example, three trajectory points with serial numbers of 3, 4 and 5.In the description hereinafter, these three trajectory points arerespectively called trajectory point 3, trajectory point 4 andtrajectory point 5, and accordingly, these three trajectory units arerespectively called trajectory unit E3, trajectory unit E4 andtrajectory unit E5.

For example, according to the slope of the connection line between thetrajectory point 4 and the trajectory point 3, the coordinate of thetrajectory point 4 and the coordinate of the trajectory point 3, it isdetermined that the trajectory unit E4 corresponding to the trajectorypoint 4 adopts the first connection mode, so as to obtain the twoconnection points m and n of the trajectory unit E4 by calculating.According to the slope of the connection line between the trajectorypoint 5 and the trajectory point 4, the coordinate of the trajectorypoint 5 and the coordinate of the trajectory point 4, it is determinedthat the trajectory unit E5 corresponding to the trajectory point 5adopts the second connection mode, so as to obtain the two connectionpoints B1 and B2 of the trajectory unit E5 by calculating. The twoconnection points B3 and B4 of the trajectory unit E3 can be obtained bycalculating according to the trajectory point 3 and the trajectory point2 (not shown in the figure), and the trajectory unit E3 adopts the firstconnection mode, for example.

Before filling the polygon formed by the connection point m andconnection point n of the trajectory unit E4 and the connection pointsB3 and B4 of the trajectory unit E3, it is judged whether the connectionmode of the trajectory unit E4 is different from the connection mode ofthe trajectory unit E3. In this example, the connection mode of thetrajectory unit E4 is the same as the connection mode of the trajectoryunit E3, which are both the first connection mode, and therefore, thepolygon formed by connection points m, n, B3 and B4 is filled.

Before filling the polygon formed by the connection points B1 and B2 ofthe trajectory unit E5 and the connection points m and n of thetrajectory unit E4, it is judged whether the connection mode of thetrajectory unit E5 is different from the connection mode of thetrajectory unit E4. In this example, the connection mode of thetrajectory unit E5 is different from the connection mode of thetrajectory unit E4, and the connection mode of the trajectory unit E5 isthe second connection mode, while the connection mode of the trajectoryunit E4 is the first connection mode. Therefore, it is needed to adoptthe connection mode of the trajectory unit E5 (i.e., the secondconnection mode) to calculate the connection points of the trajectoryunit E4 again, and obtain the connection points m′ and n′, which arecalled the repeated connection points of the trajectory unit E4.

Thereby, the trajectory unit E4 has not only the connection points m andn, but also the repeated connection points m′ and n′. The polygonbetween the trajectory unit E4 and the trajectory unit E5 is formedbased on the repeated connection points m′ and n′, while the polygonbetween the trajectory unit E4 and the trajectory unit E3 is formedbased on the connection points m and n, and therefore, the handwritingformed after filling can have no gap at the connection position (i.e.,the position of the trajectory unit E4), so that different strokes canbe connected continuously and transitioned smoothly, thereby improvingthe aesthetics of the handwriting.

For example, in at least one embodiment, before establishing a pluralityof trajectory units in a raindrop shape, the handwriting forming methodcan further include an operation for realizing a pen edge effect, andthe operation is as follows.

Step S160: selecting continuous Z trajectory points including the pendrop point, adding a compensation value to the pressure value in thetrajectory information of each of the Z trajectory points to obtain anupdated pressure value, and replacing the pressure value in thetrajectory information with the updated pressure value.

For example, 5≤Z≤15 and Z is an integer. For example, in some examples,Z=9.

When the user drops the pen during the writing process, the pen edgeeffect helps to improve the aesthetics of the handwriting, and thetrajectory unit corresponding to a single trajectory point is not enoughto show a full pen drop. Because the pressure value when dropping thepen is usually small, in step S160, the pressure values corresponding tothe Z continuous trajectory points including the pen drop point arecompensated, and then the compensated pressure values are used toestablish the trajectory unit and perform subsequent processing, therebyforming a stable and full pen drop, so as to form pen edge effect. Forexample, the Z compensation values corresponding to the above Ztrajectory points decrease in turn. In addition, in the aforementionedpressure sensing formula, in the case that the pressure value is lessthan 0.4, the pressure sensing amount is equal to the constant of 0.25,which also helps to obtain the pen edge effect.

For example, in some examples, in the case of Z=9, the pressure valuescorresponding to nine continuous trajectory points including the pendrop point (that is, the nine trajectory points including the pen droppoint) are added with the compensation values of 0.3, 0.23, 0.2, 0.17,0.15, 0.1, 0.08, 0.04, and 0.01, respectively. After obtaining theupdated pressure values, the pressure values in the trajectoryinformation are replaced with the updated pressure values, and thensubsequent operations such as establishing the trajectory unit areperformed based on the trajectory information. In this way, thetrajectory units corresponding to the nine trajectory points aredecreased in turn, and by filling the polygon between the trajectoryunits, a full pen drop can be formed, which has beautiful pen edgeeffect.

It should be noted that in the embodiments of the present disclosure,the specific value of the compensation value used for the pen edgeprocessing is not limited, and the compensation value in the aboveexample is only exemplary rather than restrictive, which can bedetermined according to actual needs, and only needs to allow theplurality of compensation values to decrease in turn, and theembodiments of the present disclosure are not limited in this aspect.The number of the trajectory points used for the pen edge processing isalso unlimited, which can be determined according to actual needs, forexample, according to the pen edge effect that is required to beachieved.

For example, in at least one embodiment, the handwriting forming methodcan further include the following operations.

Step S170: performing an anti-aliasing treatment on the edge lines of afilled pattern.

In some display devices, due to the characteristics of raster graphicsdisplay, for non-horizontal and non-vertical lines or polygonalboundaries, there may be a jagged or stepped appearance, thereby formingedge burr. The information distortion after reconstruction due toinsufficient sampling caused by such discrete sampling is calledaliasing. In order to improve the aesthetics, an anti-aliasing treatmentcan be performed on the edge lines of the filled pattern, therebyreducing or eliminating the edge burr of the lines.

For example, the above step S170 can be performed simultaneously withthe step S120 shown in FIG. 1 or after the step S120, so as to eliminateburrs at the boundaries of the trajectory unit. For another example, theabove step S170 can be performed simultaneously with the step S140 shownin FIG. 1 or after the step S140, so as to eliminate burrs at theboundaries of the polygon between the trajectory units. For stillanother example, the above step S170 can be performed before displayingthe handwriting with the display device, so as to eliminate the edgeburrs in the handwriting completely. Regarding the execution way andexecution time of the above step S170, the embodiments of the presentdisclosure are not limited in this aspect.

For example, in some examples, as shown in FIG. 11 , the above step S170may include the following operations.

Step S171: dividing each display pixel that the edge line passes throughinto two regions according to the diagonal line of the display pixel,and the sign of the slope of the diagonal line being the same as thesign of the slope of the edge line;

step S172: judging the region where the line segment of the edge linepassing through the display pixel is located;

step S173: in the case where the line segment is located in one of thetwo regions, allowing the display pixel where the line segment islocated and the display pixel that is adjacent to the region where theline segment is located in the y direction to display; and

step S174: in the case where the line segment coincides with thediagonal line, allowing the display pixel where the line segment islocated to display.

FIG. 12A is a schematic diagram showing the anti-aliasing treatmentprovided by at least one embodiment of the present disclosure, and FIG.12B is an enlarged view of area F in FIG. 12A. The above steps S171-S174are described below in combination with FIG. 12A and FIG. 12B.

In the case that two coordinate points and the line between these twocoordinate points need to be displayed, after obtaining the twocoordinate points and the line width w, four vertices of the rectanglewith the line where the two coordinate points are located as the centralaxis and w as the line width and the slope k can be determined, and thenthe anti-aliasing treatment is performed on the line with the slope k.For example, in some examples, as shown in FIG. 12A, the anti-aliasingtreatment needs to be performed on the line Lz with a slope of k shownin the figure, and a plurality of squares arranged in an array in thefigure represent display pixels arranged in an array.

First, in step S171, each display pixel that the edge line passesthrough is divided into two regions according to the diagonal line ofthe display pixel, and the sign of the slope of the diagonal line is thesame as the sign of the slope of the edge line. For example, as shown inFIG. 12A and FIG. 12B, the display pixel D1 that the line Lz passesthrough is divided into two regions according to the diagonal line L1 ofthe display pixel D1, which are a first region Z1 and a second regionZ2, respectively. For example, the sign of the slope of the diagonalline L1 is the same as the sign of the slope k of the line Lz. In thisexample, the slope k of the line Lz is negative, and therefore the slopeof the diagonal line L1 is also negative. It should be noted that thedisplay pixel D1 is a square, which has two diagonal lines perpendicularto each other, the slope of one diagonal line is positive, and the slopeof the other diagonal line is negative. In the case that the displaypixel D1 is divided into regions, the sign of the slope of the diagonalline adopted is the same as the sign of the slope k of the line Lz.

Then, in step S172, the region, where the line segment of the edge linepassing through the display pixel is located, is judged. For example, asshown in FIG. 12A and FIG. 12B, in this example, the line segment of theline Lz passing through the display pixel D1 is located in the secondregion Z2.

In step S173, if the line segment is located in one of the two regions,the display pixel where the line segment is located and the displaypixel adjacent to the region where the line segment is located in the ydirection are displayed. For example, as shown in FIG. 12A and FIG. 12B,in this example, the line segment of the line Lz passing through thedisplay pixel D1 is located in the second region Z2, and therefore thedisplay pixel D1 and the display pixel D2 adjacent to the second regionZ2 in the y direction are displayed. At this time, although the line Lzpasses through the display pixel D1 rather than the display pixel D2,both the display pixel D1 and the display pixel D2 are displayed. Inother examples, if the line segment of the line Lz passing through thedisplay pixel D1 is located in the first region Z1, the display pixel D1and the display pixel adjacent to the first region Z1 in the y directionare displayed.

In step S174, if the line segment coincides with the diagonal line, thedisplay pixel where the line segment is located is displayed. At thistime, only the display pixel that the line segment passes through isdisplayed, and other display pixels adjacent to the display pixel in they direction are not displayed. This case is not shown in FIG. 12B.

For example, in some examples, the above steps S172-S174 can also beimplemented by adopting the following method. The coordinate value ofthe center of the display pixel (that is, the center of the square) is afloating-point value. xi represents the x-axis coordinate of the centerof the display pixel, any point on the line segment of the line Lzpassing through the display pixel D1 can be expressed as M (xi, kx+b), krepresents the slope, and b represents the offset of the line Lz. Thevertices of the region where the line segment of the line Lz passingthrough the display pixel D1 is located (the point at the upper rightcorner of the display pixel D1 in FIG. 12B) can be expressed as N (int(xi)+1, int (kx+b)+1).

If the distance d_(MN) from N to the line Lz is equal to √{square rootover (2)}/2, it is determined that the line segment of the line Lzpassing through the display pixel D1 coincides with the diagonal line ofthe display pixel D1, and therefore the display pixel D1 is displayed,and other display pixels adjacent to the display pixel D1 in the ydirection are not displayed. If the distance d_(MN) from N to the lineLz is less than √{square root over (2)}/2, it is determined that theline segment of the line Lz passing through the display pixel D1 islocated in the second region Z2, and therefore the display pixel D1 andthe display pixel D2 adjacent to the second region Z2 in the y directionare displayed. For example, the display pixel D2 is the display pixelwhere the coordinate point (xi, kx+b+1) is located. If the distanced_(MN) from N to the line Lz is greater than √{square root over (2)}/2,it is determined that the line segment of the line Lz passing throughthe display pixel D1 is located in the first region Z1, and thereforethe display pixel D1 and the display pixel adjacent to the first regionZ1 in the y direction (not shown in FIG. 12B) are displayed. Forexample, the display pixel is the display pixel where the coordinatepoint (xi, kx+b−1) is located.

It should be noted that because the side length of the display pixel isnormalized and set to 1, the distance from the vertices of the displaypixel to its diagonal line is equal to √{square root over (2)}/2, andthereby, determining the relationship between the distance d_(MN) fromthe vertex N to the line Lz and √{square root over (2)}/2 is essentiallyconsistent with determining the region where the line segment of theline Lz passing through the display pixel. In this example, because theslope k of the line Lz is negative, the point at the upper right cornerof the display pixel is selected as the vertex aforementioned. In otherexamples, in the case that the slope of the line is positive, the pointat the upper left corner of the display pixel needs to be selected asthe vertex aforementioned.

FIG. 13 is an effect comparison diagram of the anti-aliasing treatmentprovided by at least one embodiment of the present disclosure. Accordingto FIG. 13 , after the anti-aliasing treatment, the smoothness of theedge lines of the display pattern is greatly improved, the edge burr issignificantly alleviated, and the aesthetics of the display pattern isimproved.

For example, in some examples, when performing the anti-aliasingtreatment, if the display pixel adjacent to the region where the linesegment of the edge line is located in the y direction needs to bedisplayed, the transparency of the adjacent display pixel can be set toachieve a better processing effect.

For example, the transparency of the adjacent display pixel can becalculated according to the following formula:

${{Td} = {❘{1 - \frac{d_{MN}}{\sqrt{2}/2}}❘}},$where Td represents the transparency, d_(MN) represents the distancebetween the vertices of the region where the corresponding line segmentis located and the line segment. For related descriptions of d_(MN),vertices and so on, reference can be made to the foregoing contents,which may not be repeated here.

For example, Td=1 means opaque, Td=0 means fully transparent, and 0<Td<1means transparent in a certain extent and the degree of transparencydecreases with the increase of the value. According to the aboveformulas, the closer the line segment is to the vertex, the opaquer theadjacent display pixel is; the closer the line segment is to thediagonal line of the display pixel, the more transparent the adjacentdisplay pixel is. In actual display, the product of the color value (orgray scale value) and transparency is a final displayed color value (orgray scale value). By setting the transparency, the anti-aliasingtreatment can have better processing effect and make the formedhandwriting more beautiful.

It should be noted that in the embodiments of the present disclosure,the method of performing the anti-aliasing treatment is not limited tothe method described above, and can also be any applicable anti-aliasingtreatment method, which can be determined according to actual needs, andthe embodiments of the present disclosure are not limited in thisaspect. For example, the method of common anti-aliasing treatment can beadopted, or the method of the anti-aliasing treatment described abovecan be modified and adjusted, and the embodiments of the presentdisclosure are not limited in this aspect.

It should be noted that in the embodiments of the present disclosure,the execution order of each step of the handwriting forming method isnot limited, although the execution process of each step is described ina specific order above, it does not constitute a restriction on theembodiments of the present disclosure. Respective steps in thehandwriting forming method can be executed in serial or parallel, whichcan be determined according to actual needs. The handwriting formingmethod can also include more or less steps, and the embodiments of thepresent disclosure are not limited in this aspect.

FIG. 14 is an application flow diagram of a handwriting forming methodprovided by at least one embodiment of the present disclosure. Theapplication flow of the handwriting forming method provided by theembodiments of the present disclosure is described exemplarily incombination with FIG. 14 .

First, the user writes on the working surface of the touch device (forexample, touch screen) with fingers or a stylus, for example, thewriting path is the Chinese character “Jia”, the touch device detectsand obtains all the sampling points on the writing path andcorresponding coordinates, pressure values and flag bits. Then, all thesampling points are sparsely sampled and smoothed (or interpolated) toobtain a plurality of trajectory points and trajectory information. Thetrajectory information includes, for example, a coordinate, a pressurevalue, and a flag bit.

Then, the coordinate point level processing is performed. Based on thetrajectory information, the trajectory unit for each of the trajectorypoints is established, and the anti-aliasing treatment is performed onthe edge lines of the trajectory units. The connection mode between thetrajectory units corresponding to the adjacent trajectory points isdetermined based on the trajectory information. After the connectionmode is determined, the connection points of the trajectory units arecalculated according to the connection mode, and the polygon formed bythe connection points of the trajectory units corresponding to theadjacent trajectory points is filled. In addition, the anti-aliasingtreatment is performed on the edge lines of the filled polygon.

Through the above processing, the displayed handwriting can be formed,for example, the handwriting is displayed as the Chinese brush pencharacter “Jia”. When the user writes any Chinese characters or strokeson the working surface of the touch device, the corresponding Chinesebrush pen handwriting can be formed by using the above method, therebyproviding the user with a new sensory experience and improving the userexperience. The handwriting forming method can obtain beautiful Chinesebrush pen handwriting, make the handwriting smooth, and can embodyvarious strokes, the calculation amount is small, the processingefficiency is high, the real-time performance is strong, and the methodis simple and practical.

FIG. 15 is a system diagram that can be used to implement thehandwriting forming method provided by the embodiments of the presentdisclosure. As shown in FIG. 15 , the system 10 may include a userterminal 11, a network 12, a server 13, and a database 14. For example,the system 10 can be used to implement the handwriting forming methodprovided by any embodiment of the present disclosure.

The user terminal 11 is, for example, a computer 11-1 or a mobile phone11-2. It can be understood that the user terminal 11 can be any othertype of electronic device that can perform data processing and has touchdetection function, which can include but is not limited to a desktopcomputer, a notebook computer, a tablet computer, a smart phone, a smarthome device, a wearable device, an in-vehicle electronic device, amonitoring device, an outdoor billboard, a conference whiteboard, etc.The user terminal 11 can also be any equipment provided with anelectronic device, for example, a vehicle, a robot, etc.

The user can operate the application programs installed on the userterminal 11, the application programs transmit the user behavior data tothe server 13 through the network 12, and the user terminal 11 can alsoreceive the data transmitted by the server 13 through the network 12.The user terminal 11 can implement the handwriting forming methodprovided by the embodiments of the present disclosure by running aprogram or a thread.

In some examples, the user terminal 11 can perform the handwritingforming method by using its built-in application program. In otherexamples, the user terminal 11 can perform the handwriting formingmethod by calling the application program stored outside the userterminal 11. For example, the user can write on the working surface ofthe touch device of the user terminal 11 with fingers or a stylus, andthe user terminal 11 performs the handwriting forming method provided bythe embodiments of the present disclosure, thereby displaying the user'shandwriting as Chinese brush pen handwriting.

The network 12 can be a single network or a combination of at least twodifferent networks. For example, the network 12 can include, but is notlimited to, a combination of one or more of a local area network, a widearea network, a public network, a private network, etc., for example, awired network, a wireless network, or any combination thereof.

The server 13 can be a single server or a server group, and each serverin the server group is connected through a wired network or a wirelessnetwork; and the server 13 can also be a cloud server. The server groupcan be centralized, such as a data center, or distributed. The server 13can be local or remote.

The database 14 can generally refer to a device having a storagefunction. The database 14 is mainly used for storing various data thatis used, produced and output by the user terminal 11 and the server 13in the work. The database 14 can be local or remote. The database 14 caninclude various memories, for example, random access memory (RAM), readonly memory (ROM), etc. The above-mentioned storage device are just someexamples, and the storage device that can be used by the system 10 arenot limited to these.

The database 14 can be interconnected or communicated with the server 13or a portion thereof via the network 12, or directly interconnected orcommunicated with the server 13, or a combination of the above twomethods can be adopted.

In some examples, the database 14 can be a stand-alone device. In otherexamples, the database 14 can also be integrated in at least one of theuser terminal 11 and the server 13. For example, the database 14 can bearranged on the user terminal 11 or on the server 13. For anotherexample, the database 14 can also be distributed, one part of which isarranged on the user terminal 11, and the other part of which isarranged on the server 13.

At least one embodiment of the present disclosure also provides ahandwriting forming apparatus. The handwriting forming apparatus canobtain beautiful Chinese brush pen handwriting, make the handwritingsmooth, and can embody various strokes, the calculation amount is small,the processing efficiency is high, the real-time performance is strong,and the apparatus is simple and practical.

FIG. 16 is a schematic block diagram of a handwriting forming apparatusprovided by at least one embodiment of the present disclosure. As shownin FIG. 16 , the handwriting forming apparatus 20 includes a samplingunit 21, a modeling unit 22, a connection mode determining unit 23, anda filling unit 24. For example, the handwriting forming apparatus 20 canbe applied to application programs such as writing software and drawingsoftware, and can also be applied to any device or system that needs toform Chinese brush pen handwriting, and the embodiments of the presentdisclosure are not limited in this aspect.

The sampling unit 21 is configured to determine a group of plurality oftrajectory points according to a plurality of sampling points on thewriting path on the working surface of the touch device and obtain thetrajectory information of each of the plurality of trajectory points.For example, the trajectory information includes a coordinate, a flagbit and a pressure value, and the flag bit includes data indicatingwhether a corresponding trajectory point is a pen drop point. Forexample, the sampling unit 21 can perform the step S110 of thehandwriting forming method shown in FIG. 1 . The modeling unit 22 isconfigured to establish a plurality of trajectory units in a raindropshape corresponding to a plurality of trajectory points in one-to-onecorrespondence based on the trajectory information. For example, themodeling unit 22 can perform the step S120 of the handwriting formingmethod shown in FIG. 1 . The connection mode determination unit 23 isconfigured to determine the connection mode between the trajectory unitscorresponding to the adjacent trajectory points based on the trajectoryinformation. For example, the connection mode determination unit 23 canperform the step S130 of the handwriting formation method shown in FIG.1 . The filling unit 24 is configured to calculate the connection pointsof the trajectory units according to the connection mode, and fill thepolygon formed by the connection points of the trajectory unitscorresponding to the adjacent trajectory points, so as to form thehandwriting for displaying. For example, the filling unit 24 can performthe step S140 of the handwriting forming method shown in FIG. 1 .

For example, the sampling unit 21, the modeling unit 22, the connectionmode determining unit 23, and the filling unit 24 can be hardware,software, firmware, and any feasible combination thereof. For example,the sampling unit 21, the modeling unit 22, the connection modedetermining unit 23 and the filling unit 24 can be dedicated orgeneral-purpose circuits, chips, or devices, etc., or can be acombination of a processor and a memory. Regarding the specificimplementation form of each of the above units, the embodiments of thepresent disclosure are not limited in this aspect.

It should be noted that in the embodiments of the present disclosure,each unit of the handwriting forming apparatus 20 corresponds to eachstep of the aforementioned handwriting forming method, and regarding thespecific function of the handwriting forming apparatus 20, reference canbe made to the relevant description of the handwriting forming method,which may not be repeated here. The components and structures of thehandwriting forming apparatus 20 shown in FIG. 16 are only exemplaryrather than restrictive, and the handwriting forming apparatus 20 canalso include other components and structures as required.

At least one embodiment of the present disclosure also provides anelectronic device, the electronic device includes a processor and amemory, one or more computer program modules are stored in the memoryand configured for execution by the processor, and one or more computerprogram modules include instructions for implementing the handwritingforming method provided by any embodiment of the present disclosure. Theelectronic device can obtain beautiful Chinese brush pen handwriting,make the handwriting smooth, and can embody various strokes, thecalculation amount is small, the processing efficiency is high, thereal-time performance is strong, and the device is simple and practical.

FIG. 17 is a schematic block diagram of an electronic device provided byat least one embodiment of the present disclosure. As shown in FIG. 17 ,the electronic device 30 includes a processor 31 and a memory 32. Thememory 32 is used to store non-volatile computer-readable instructions(for example, one or more computer program modules). The processor 31 isused to run non-volatile computer-readable instructions, and when thenon-volatile computer-readable instructions are run by the processor 31,one or more steps of the handwriting forming method described above canbe performed. The memory 32 and the processor 31 can be interconnectedby a bus system and/or other forms of connection mechanism (not shown).For example, the electronic device 30 can adopt operating systems suchas Windows, Android, etc., and the handwriting forming method accordingto the embodiments of the present disclosure is realized by theapplication program running in the operating system.

For example, the processor 31 can be a central processing unit (CPU), agraphics processing unit (GPU), a digital signal processor (DSP) orother forms of processing units with data processing capability and/orprogram execution capability, for example, a field programmable gatearray (FPGA), etc. For example, the central processing unit (CPU) can beX86 or ARM architecture and so on. The processor 31 can be ageneral-purpose processor or a dedicated processor and can control othercomponents in the electronic device 30 to perform desired functions.

For example, the memory 32 can includes any combination of one or morecomputer program products, and the computer program products can includevarious forms of computer-readable storage media, such as the volatilememory and/or the non-volatile memory. The volatile memory can include,for example, a random access memory (RAM) and/or a cache memory (cache),etc. The non-volatile memory can include, for example, a read onlymemory (ROM), a hard disk, an erasable programmable read only memory(EPROM), a portable compact disk read only memory (CD-ROM), a USBmemory, a flash memory, and so on. One or more computer program modulescan be stored on computer-readable storage media, and the processor 31can run one or more computer program modules to implement variousfunctions of the electronic device 30. The computer-readable storagemedia can also store various application programs and various data aswell as various data used and/or produced by the application programs.

It should be noted that in the embodiments of the present disclosure,for the specific functions and technical effects of the electronicdevice 30, reference can be made to the above description of thehandwriting forming method, which may not be repeated here.

FIG. 18 is a schematic block diagram of another electronic deviceprovided by at least one embodiment of the present disclosure. Forexample, as shown in FIG. 18 , in addition to the processor 31 and thememory 32, the electronic device 30 can further include a touch device33 and a display device 34.

For example, the touch device 33 is configured to acquire an initialhandwriting on the working surface of the touch device 33. For example,the touch device 33 can be a touch screen or a touch pad. The touchscreen can be a capacitive touch screen, such as a self-capacitive touchscreen or a mutual-capacitive touch screen, and can also be a resistivetouch screen, a surface acoustic wave touch screen, an infrared touchscreen, etc. For example, the touch device 33 can include a touch sensorand a controller (for example, a driver IC), the controller receives anelectrical signal collected by the touch sensor, processes theelectrical signal to obtain a touch signal, and provides the touchsignal to the processor 31 for further processing, so as to realize thehandwriting forming method provided by the embodiments of the presentdisclosure. The embodiments of the present disclosure do not limit thetype, structure, and communication mode of the touch device 33. Thetouch device 33 includes a working surface with a certain area, the usercan write directly on the working surface of the touch device 33 withhis/her fingers, or write on the working surface of the touch device 33with an active stylus or a passive stylus, and the embodiments of thepresent disclosure are not limited in this aspect. Here, the workingsurface refers to a surface for detecting the touch operations of theuser, such as the touch surface of the touch device 33. It should benoted that in the embodiments of the present disclosure, the type of thetouch device 33 is not limited, and it can be not only a touch screen,but also any device with touch function such as an interactivewhiteboard, which can be determined according to actual needs.

For example, the display device 34 is configured to display thehandwriting formed by the handwriting forming method. For example, thehandwriting forming method is the handwriting forming method provided byany embodiment of the present disclosure. The display device 34 is, forexample, an LCD display screen, an OLED display screen, a QLED displayscreen, a projection component, a VR head mounted display device (forexample, a VR helmet, VR glasses, etc.), an AR display device, etc., andthe embodiments of the present disclosure are not limited in thisaspect. The display device 34 can display the handwriting formed by thehandwriting forming method provided by the embodiments of the presentdisclosure, such as Chinese brush pen handwriting.

For example, in some examples, the touch device 33 and the displaydevice 34 are two independent devices, the touch device 33 has a touchfunction but does not have a display function, and the display device 34has a display function but does not have a touch function. For example,in other examples, the touch device 33 and the display device 34 are thesame one device, which has both the touch function and the displayfunction. Regarding the structure form of the touch device 33 and thedisplay device 34, reference can be made to the conventional design,which may not be described in detail here.

FIG. 19 is a schematic block diagram of yet another electronic deviceprovided by at least one embodiment of the present disclosure. Theelectronic device 40 is suitable for implementing, for example, thehandwriting forming method provided by the embodiments of the presentdisclosure. The electronic device 40 can be a terminal device and so on.It should be noted that the electronic device 40 shown in FIG. 19 ismerely an example, which does not bring any limitation to the functionand use scope of the embodiments of the present disclosure.

As shown in FIG. 19 , the electronic device 40 can include a processingdevice (for example, a central processing unit, a graphics processor,etc.) 41, which can perform various appropriate actions and processesaccording to the programs stored in the read only memory (ROM) 42 or theprograms loaded into the random access memory (RAM) 43 from the storagedevice 48. In the RAM 43, various programs and data required for theoperations of the electronic device 40 are also stored. The processingdevice 41, ROM 42 and RAM 43 are connected to each other through a bus44. Input/output (I/O) interface 45 is also connected to the bus 44.

Generally, the following devices can be connected to the I/O interface45: an input device 46 including, for example, a touch screen, a touchpad, a keyboard, a mouse, a camera, a microphone, an accelerometer, agyroscope, etc.; an output device 47 including, for example, a liquidcrystal display (LCD), a loudspeaker, a vibrator, etc.; a storage device48 including, for example, a magnetic tape, a hard disk, etc.; and acommunication device 49. The communication device 49 can allow theelectronic device 40 to communicate with other electronic device toexchange data in wireless way or wired way. Although FIG. 19 shows anelectronic device 40 with various devices, it should be understood thatit is not required to implement or have all the devices shown, and thatthe electronic device 40 can alternatively implement or have more orless devices.

For example, according to the embodiments of the present disclosure, theabove-mentioned handwriting forming method can be implemented as acomputer software program. For example, the embodiments of the presentdisclosure include a computer program product, which includes computerprograms carried on non-volatile computer-readable media, and thecomputer programs include program codes for executing theabove-mentioned handwriting forming method. In such embodiments, thecomputer programs can be downloaded and installed from the networkthrough the communication device 49, or from the storage device 48, orfrom ROM 42. When the computer programs are executed by the processingdevice 41, the functions defined in the handwriting forming methodprovided by the embodiments of the present disclosure can be executed.

The following statements should be noted.

(1) The attached drawings of the embodiments of the present disclosureonly involves the structures related to the embodiments of the presentdisclosure, and other structures can be referred to the general design.

(2) In the case of no conflicts, the features in the same embodimentsand different embodiments of the present disclosure can be combined witheach other.

The above are only exemplary embodiments of the present disclosure, butthe protection scope of the present disclosure is not limited to this,and the protection scope of the present disclosure should be subject tothe protection scope of the claims.

What is claimed is:
 1. A handwriting forming method, comprising:determining a group of plurality of trajectory points according to aplurality of sampling points on a writing path on a working surface of atouch device and obtaining trajectory information of each of theplurality of trajectory points, wherein the trajectory informationcomprises a coordinate, a flag bit and a pressure value, and the flagbit comprises data indicating whether a corresponding trajectory pointis a pen drop point; establishing a plurality of trajectory units in araindrop shape corresponding to the plurality of trajectory points inone-to-one correspondence based on the trajectory information;determining a connection mode between trajectory units corresponding toadjacent trajectory points based on the trajectory information; andcalculating connection points of the trajectory units according to theconnection mode, and filling a polygon formed by the connection pointsof the trajectory units corresponding to the adjacent trajectory points,so as to form a handwriting for displaying, wherein the establishing theplurality of trajectory units in the raindrop shape corresponding to theplurality of trajectory points in one-to-one correspondence based on thetrajectory information comprises: determining a first circle centercoordinate of a first circle and a first radius of the first circle;determining a second circle center coordinate of a second circle and asecond radius of the second circle; and filling the first circle and thesecond circle, and filling a polygon formed by common tangent points ofthe first circle and common tangent points of the second circle, whereinthe determining the connection mode between the trajectory unitscorresponding to the adjacent trajectory points based on the trajectoryinformation comprises: for trajectory points other than the pen droppoint, calculating a slope of a connection line between a currenttrajectory point and a previous trajectory point; and according to theslope, a coordinate of the current trajectory point, and a coordinate ofthe previous trajectory point, determining a connection mode adopted bya trajectory unit corresponding to the current trajectory point.
 2. Themethod according to claim 1, wherein the first circle center coordinateis a coordinate of the corresponding trajectory point, the first radiusis a product of a pressure sensing amount and a plurality of writingparameter preset values, the pressure sensing amount is obtained basedon a pressure value of the corresponding trajectory point, and the firstradius is greater than the second radius.
 3. The method according toclaim 2, wherein the pressure sensing amount is calculated according toa pressure sensing function: ${Pz} = \left\{ {\begin{matrix}{{{0.\ 2}5},{P < {0.4}}} \\{{P^{2}/0.64},{{0.4} \leq P < 0.8}} \\{1,{P \geq {0.8}}}\end{matrix},} \right.$ where Pz represents the pressure sensing amountand P represents the pressure value.
 4. The method according to claim 1,wherein the second circle center coordinate is obtained according to thefirst circle center coordinate, a circle center distance, and an angleof a circle center connection line, the circle center distance is Qtimes of a product of a brush length and a pressure value of thecorresponding trajectory point, and 2≤Q≤7, the angle of the circlecenter connection line is an angle between a connection line between acircle center of the first circle and a circle center of the secondcircle and an x-axis direction of a coordinate system where the firstcircle center coordinate is located, and the angle of the circle centerconnection line ranges from 15 to 60 degrees.
 5. The method according toclaim 1, wherein the second radius is calculated according to a formula:R2=0.5*R1*t, where R1 represents the first radius, R2 represents thesecond radius, t represents an ink density, t=max(0.8*T/n,0.6), T is aconstant, and n is a serial number of a trajectory point.
 6. The methodaccording to claim 1, wherein the slope is calculated according to aformula: ${k = \frac{{y2} - {y1}}{{x2} - {x1}}},$ where k represents theslope, (x2, y2) represents the coordinate of the current trajectorypoint, and (x1, y1) represents the coordinate of the previous trajectorypoint.
 7. The method according to claim 6, wherein the connection modecomprises a first connection mode, a second connection mode, a thirdconnection mode, and a fourth connection mode, and according to theslope, the coordinate of the current trajectory point, and thecoordinate of the previous trajectory point, determining the connectionmode adopted by the trajectory unit corresponding to the currenttrajectory point comprises: in a case where |k|≤0.6 or |x2−x1|<1,determining that the trajectory unit corresponding to the currenttrajectory point adopts the first connection mode; in a case where−0.9<k<−0.6 and x2>x1, determining that the trajectory unitcorresponding to the current trajectory point adopts the secondconnection mode; in a case where 0.6<k<1 and y2<y1, determining that thetrajectory unit corresponding to the current trajectory point adopts thethird connection mode; and otherwise, determining that the trajectoryunit corresponding to the current trajectory point adopts the fourthconnection mode.
 8. The method according to claim 7, wherein calculatingthe connection points of the trajectory units according to theconnection mode, and filling the polygon formed by the connection pointsof the trajectory units corresponding to the adjacent trajectory points,so as to form the handwriting for displaying, comprises: for thetrajectory points other than the pen drop point, calculating theconnection points of the trajectory unit according to one selected froma group consisting of the first connection mode, the second connectionmode, the third connection mode, and the fourth connection mode that aredetermined; and filling the polygon formed by the connection points ofthe trajectory units corresponding to the adjacent trajectory points. 9.The method according to claim 8, wherein the connection points of thetrajectory unit comprise a first connection point m1 and a secondconnection point n1, and in a case of adopting the first connectionmode, the first connection point m1 and the second connection point n1are calculated according to a formula: $\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{floor}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$ where (m.x, m.y) represents a coordinate of thefirst connection point m1, (n.x, n.y) represents a coordinate of thesecond connection point n1, (c1.x, c1.y) represents the first circlecenter coordinate, (c2.x, c2.y) represents the second circle centercoordinate, R1 represents the first radius, R2 represents the secondradius, θ represents an angle of a circle center connection line, andthe coordinate of the first connection point m1, the coordinate of thesecond connection point n1, the first circle center coordinate, and thesecond circle center coordinate are located in a same coordinate systemon the working surface of the touch device.
 10. The method according toclaim 8, wherein the connection points of the trajectory unit comprise afirst connection point m2 and a second connection point n2, and in acase of adopting the second connection mode, the first connection pointm2 and the second connection point n2 are calculated according to aformula: $\left\{ {\begin{matrix}{{m.x} = {{c{2.x}} - {R1}}} \\{{m.y} = {{{floor}\left( {{c2.y} - {R2}} \right)} - 2}} \\{{n.x} = {{c{2.x}} - {R1}}} \\{{n.y} = {{{ceil}\left( {{c2.y} + {R2}} \right)} + 1}}\end{matrix},} \right.$ where (m.x, m.y) represents a coordinate of thefirst connection point m2, (n.x, n.y) represents a coordinate of thesecond connection point n2, (c2.x, c2.y) represents the second circlecenter coordinate, R1 represents the first radius, R2 represents thesecond radius, and the coordinate of the first connection point m2, thecoordinate of the second connection point n2, and the second circlecenter coordinate are located in a same coordinate system on the workingsurface of the touch device.
 11. The method according to claim 8,wherein the connection points of the trajectory unit comprise a firstconnection point m3 and a second connection point n3, and in a case ofadopting the third connection mode, the first connection point m3 andthe second connection point n3 are calculated according to a formula:$\left\{ {\begin{matrix}{{m.x} = {c{2.x}}} \\{{m.y} = {{floor}\left( {{c2.y} - {R2}} \right)}} \\{{n.x} = {c{2.x}}} \\{{n.y} = {{ceil}\left( {{c2.y} + {R2}} \right)}}\end{matrix},} \right.$ where (m.x, m.y) represents a coordinate of thefirst connection point m3, (n.x, n.y) represents a coordinate of thesecond connection point n3, (c2.x, c2.y) represents the second circlecenter coordinate, R2 represents the second radius, and the coordinateof the first connection point m3, the coordinate of the secondconnection point n3, and the second circle center coordinate are locatedin a same coordinate system on the working surface of the touch device.12. The method according to claim 8, wherein the connection points ofthe trajectory unit comprise a first connection point m4 and a secondconnection point n4, and in a case of adopting the fourth connectionmode, the first connection point m4 and the second connection point n4are calculated according to a formula: $\left\{ {\begin{matrix}{{m.x} = {{floor}\left( {{c1.x} - {R1*\cos\theta}} \right)}} \\{{m.y} = {{floor}\left( {{c1.y} - {R1*\sin\theta}} \right)}} \\{{n.x} = {{ceil}\left( {{c2.x} + {R2*\cos\theta}} \right)}} \\{{n.y} = {{{floor}\left( {{c2.y} + {R2}} \right)} - 1}}\end{matrix},} \right.$ where (m.x, m.y) represents a coordinate of thefirst connection point m4, (n.x, n.y) represents a coordinate of thesecond connection point n4, (c1.x, c1.y) represents the first circlecenter coordinate, (c2.x, c2.y) represents the second circle centercoordinate, R1 represents the first radius, R2 represents the secondradius, θ represents an angle of a circle center connection line, andthe coordinate of the first connection point m4, the coordinate of thesecond connection point n4, the first circle center coordinate, and thesecond circle center coordinate are located in a same coordinate systemon the working surface of the touch device.
 13. The method according toclaim 8, wherein calculating the connection points of the trajectoryunits according to the connection mode, and filling the polygon formedby the connection points of the trajectory units corresponding to theadjacent trajectory points, so as to form the handwriting fordisplaying, further comprises: for a trajectory point serving as the pendrop point, determining connection points of a trajectory unitcorresponding to the pen drop point according to a connection mode of atrajectory unit corresponding to a trajectory point that is adjacent tothe pen drop point.
 14. The method according to claim 13, wherein forthe trajectory point serving as the pen drop point, determining theconnection points of the trajectory unit corresponding to the pen droppoint according to the connection mode of the trajectory unitcorresponding to the trajectory point that is adjacent to the pen droppoint comprises: in a case where the connection mode of the trajectoryunit corresponding to the trajectory point that is adjacent to the pendrop point is the first connection mode, the second connection mode orthe third connection mode, determining the connection points of thetrajectory unit corresponding to the pen drop point by adopting theconnection mode of the trajectory unit corresponding to the trajectorypoint that is adjacent to the pen drop point; and in a case where theconnection mode of the trajectory unit corresponding to the trajectorypoint that is adjacent to the pen drop point is the fourth connectionmode, calculating a first connection point m5 and a second connectionpoint n5 of the trajectory unit corresponding to the pen drop pointaccording to a formula: $\left\{ {\begin{matrix}{{m.x} = {c{1.x}}} \\{{m.y} = {{c{1.y}} + {R1}}} \\{{n.x} = {{c{2.x}} + {R2*\cos\theta}}} \\{{n.y} = {{c{2.y}} + {R2*\sin\theta} + 1}}\end{matrix},} \right.$ where (m.x, m.y) represents a coordinate of thefirst connection point m5, (n.x, n.y) represents a coordinate of thesecond connection point n5, (c1.x, c1.y) represents the first circlecenter coordinate, (c2.x, c2.y) represents the second circle centercoordinate, R1 represents the first radius, R2 represents the secondradius, θ represents an angle of a circle center connection line, andthe coordinate of the first connection point m5, the coordinate of thesecond connection point n5, the first circle center coordinate, and thesecond circle center coordinate are located in a same coordinate systemon the working surface of the touch device.
 15. The method according toclaim 8, wherein calculating the connection points of the trajectoryunits according to the connection mode, and filling the polygon formedby the connection points of the trajectory units corresponding to theadjacent trajectory points, so as to form the handwriting fordisplaying, further comprises: before filling the polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, judging whether the connection mode of the trajectoryunit corresponding to the current trajectory point is different from theconnection mode of the trajectory unit corresponding to the previoustrajectory point; and in a case of being different, calculatingconnection points of a trajectory unit corresponding to the previoustrajectory point by adopting the connection mode of the trajectory unitcorresponding to the current trajectory point, to serve as repeatedconnection points of the trajectory unit corresponding to the previoustrajectory point, wherein in a case of filling the polygon formed by theconnection points of the trajectory units corresponding to the adjacenttrajectory points, the polygon between the trajectory unit correspondingto the previous trajectory point and the trajectory unit correspondingto the current trajectory point is formed based on the repeatedconnection points.
 16. The method according to claim 1, wherein beforeestablishing the plurality of trajectory units in the raindrop shape,the method further comprises: selecting continuous Z trajectory pointscomprising the pen drop point, adding a compensation value to thepressure value in the trajectory information of each of the Z trajectorypoints to obtain an updated pressure value, and replacing the pressurevalue in the trajectory information with the updated pressure value,where 5≤Z≤15 and Z is an integer.
 17. The method according to claim 16,wherein Z compensation values corresponding to the Z trajectory pointsare successively reduced.
 18. A handwriting forming apparatus,comprising a processor configured to control the following units: asampling unit, configured to determine a group of plurality oftrajectory points according to a plurality of sampling points on awriting path on a working surface of a touch device and obtaintrajectory information of each of the plurality of trajectory points,wherein the trajectory information comprises a coordinate, a flag bitand a pressure value, and the flag bit comprises data indicating whethera corresponding trajectory point is a pen drop point; a modeling unit,configured to establish a plurality of trajectory units in a raindropshape corresponding to the plurality of trajectory points in one-to-onecorrespondence based on the trajectory information; a connection modedetermining unit, configured to determine a connection mode betweentrajectory units corresponding to adjacent trajectory points based onthe trajectory information; and a filling unit, configured to calculateconnection points of the trajectory units according to the connectionmode, and fill a polygon formed by the connection points of thetrajectory units corresponding to the adjacent trajectory points, so asto form a handwriting for displaying, wherein the modeling unit isfurther configured to: determine a first circle center coordinate of afirst circle and a first radius of the first circle; determine a secondcircle center coordinate of a second circle and a second radius of thesecond circle; and fill the first circle and the second circle, andfilling a polygon formed by common tangent points of the first circleand common tangent points of the second circle, wherein the connectionmode determining unit is further configured to: for trajectory pointsother than the pen drop point, calculate a slope of a connection linebetween a current trajectory point and a previous trajectory point; andaccording to the slope, a coordinate of the current trajectory point,and a coordinate of the previous trajectory point, determine aconnection mode adopted by a trajectory unit corresponding to thecurrent trajectory point.
 19. An electronic device, comprising: aprocessor; and a memory, comprising one or more computer programmodules, wherein the one or more computer program modules are stored inthe memory and configured to be executed by the processor, and the oneor more computer program modules comprise instructions for implementingthe handwriting forming method according to claim 1.